mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
net: ena: fix coding style nits
This commit fixes two nits, but it does not generate any change to binary because of the optimization of gcc. - use `count` instead of `channels->combined_count` - change return type from `int` to `bool` Also add spaces and change macro order in OR assignment to make the code easier to read. Signed-off-by: Sameeh Jubran <sameehj@amazon.com> Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.co.jp> Signed-off-by: Shay Agroskin <shayagr@amazon.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
e9548fdf93
commit
1e5847395e
3 changed files with 6 additions and 5 deletions
|
@ -578,6 +578,7 @@ int ena_com_rx_pkt(struct ena_com_io_cq *io_cq,
|
||||||
ena_com_rx_set_flags(io_cq, ena_rx_ctx, cdesc);
|
ena_com_rx_set_flags(io_cq, ena_rx_ctx, cdesc);
|
||||||
|
|
||||||
ena_rx_ctx->descs = nb_hw_desc;
|
ena_rx_ctx->descs = nb_hw_desc;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -602,8 +603,8 @@ int ena_com_add_single_rx_desc(struct ena_com_io_sq *io_sq,
|
||||||
|
|
||||||
desc->ctrl = ENA_ETH_IO_RX_DESC_FIRST_MASK |
|
desc->ctrl = ENA_ETH_IO_RX_DESC_FIRST_MASK |
|
||||||
ENA_ETH_IO_RX_DESC_LAST_MASK |
|
ENA_ETH_IO_RX_DESC_LAST_MASK |
|
||||||
(io_sq->phase & ENA_ETH_IO_RX_DESC_PHASE_MASK) |
|
ENA_ETH_IO_RX_DESC_COMP_REQ_MASK |
|
||||||
ENA_ETH_IO_RX_DESC_COMP_REQ_MASK;
|
(io_sq->phase & ENA_ETH_IO_RX_DESC_PHASE_MASK);
|
||||||
|
|
||||||
desc->req_id = req_id;
|
desc->req_id = req_id;
|
||||||
|
|
||||||
|
|
|
@ -839,7 +839,7 @@ static int ena_set_channels(struct net_device *netdev,
|
||||||
/* The check for max value is already done in ethtool */
|
/* The check for max value is already done in ethtool */
|
||||||
if (count < ENA_MIN_NUM_IO_QUEUES ||
|
if (count < ENA_MIN_NUM_IO_QUEUES ||
|
||||||
(ena_xdp_present(adapter) &&
|
(ena_xdp_present(adapter) &&
|
||||||
!ena_xdp_legal_queue_count(adapter, channels->combined_count)))
|
!ena_xdp_legal_queue_count(adapter, count)))
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
return ena_update_queue_count(adapter, count);
|
return ena_update_queue_count(adapter, count);
|
||||||
|
|
|
@ -433,8 +433,8 @@ static inline bool ena_xdp_present_ring(struct ena_ring *ring)
|
||||||
return !!ring->xdp_bpf_prog;
|
return !!ring->xdp_bpf_prog;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int ena_xdp_legal_queue_count(struct ena_adapter *adapter,
|
static inline bool ena_xdp_legal_queue_count(struct ena_adapter *adapter,
|
||||||
u32 queues)
|
u32 queues)
|
||||||
{
|
{
|
||||||
return 2 * queues <= adapter->max_num_io_queues;
|
return 2 * queues <= adapter->max_num_io_queues;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue