OSDN Git Service
(root)
/
tomoyo
/
tomoyo-test1.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
80901bf
)
net: marvell: Use min() instead of doing it manually
author
Haowen Bai
<baihaowen88@gmail.com>
Thu, 3 Mar 2022 01:38:49 +0000
(09:38 +0800)
committer
Jakub Kicinski
<kuba@kernel.org>
Fri, 4 Mar 2022 05:06:43 +0000
(21:06 -0800)
Fix following coccicheck warning:
drivers/net/ethernet/marvell/mv643xx_eth.c:1664:35-36: WARNING opportunity for min()
Signed-off-by: Haowen Bai <baihaowen88@gmail.com>
Link:
https://lore.kernel.org/r/1646271529-7659-1-git-send-email-baihaowen88@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/marvell/mv643xx_eth.c
patch
|
blob
|
history
diff --git
a/drivers/net/ethernet/marvell/mv643xx_eth.c
b/drivers/net/ethernet/marvell/mv643xx_eth.c
index
143ca8b
..
c31cbba
100644
(file)
--- a/
drivers/net/ethernet/marvell/mv643xx_eth.c
+++ b/
drivers/net/ethernet/marvell/mv643xx_eth.c
@@
-1661,7
+1661,7
@@
mv643xx_eth_set_ringparam(struct net_device *dev, struct ethtool_ringparam *er,
if (er->rx_mini_pending || er->rx_jumbo_pending)
return -EINVAL;
- mp->rx_ring_size =
er->rx_pending < 4096 ? er->rx_pending : 4096
;
+ mp->rx_ring_size =
min(er->rx_pending, 4096U)
;
mp->tx_ring_size = clamp_t(unsigned int, er->tx_pending,
MV643XX_MAX_SKB_DESCS * 2, 4096);
if (mp->tx_ring_size != er->tx_pending)