* [PATCH v2 net-next] ethernet: marvell: Use min macro
@ 2024-08-29 3:19 Yan Zhen
2024-08-29 18:05 ` Simon Horman
0 siblings, 1 reply; 2+ messages in thread
From: Yan Zhen @ 2024-08-29 3:19 UTC (permalink / raw)
To: kuba, marcin.s.wojtas, davem, edumazet, pabeni
Cc: netdev, linux-kernel, opensource.kernel, Yan Zhen
Using the real macro is usually more intuitive and readable,
When the original file is guaranteed to contain the minmax.h header file
and compile correctly.
Signed-off-by: Yan Zhen <yanzhen@vivo.com>
---
Changes in v2:
- Rewrite the subject.
- Using umin() instead of min().
drivers/net/ethernet/marvell/mvneta.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c
index d72b2d5f96db..08d277165f40 100644
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -4750,8 +4750,7 @@ mvneta_ethtool_set_ringparam(struct net_device *dev,
if ((ring->rx_pending == 0) || (ring->tx_pending == 0))
return -EINVAL;
- pp->rx_ring_size = ring->rx_pending < MVNETA_MAX_RXD ?
- ring->rx_pending : MVNETA_MAX_RXD;
+ pp->rx_ring_size = umin(ring->rx_pending, MVNETA_MAX_RXD);
pp->tx_ring_size = clamp_t(u16, ring->tx_pending,
MVNETA_MAX_SKB_DESCS * 2, MVNETA_MAX_TXD);
--
2.34.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v2 net-next] ethernet: marvell: Use min macro
2024-08-29 3:19 [PATCH v2 net-next] ethernet: marvell: Use min macro Yan Zhen
@ 2024-08-29 18:05 ` Simon Horman
0 siblings, 0 replies; 2+ messages in thread
From: Simon Horman @ 2024-08-29 18:05 UTC (permalink / raw)
To: Yan Zhen
Cc: kuba, marcin.s.wojtas, davem, edumazet, pabeni, netdev,
linux-kernel, opensource.kernel
On Thu, Aug 29, 2024 at 11:19:06AM +0800, Yan Zhen wrote:
> Using the real macro is usually more intuitive and readable,
> When the original file is guaranteed to contain the minmax.h header file
> and compile correctly.
>
> Signed-off-by: Yan Zhen <yanzhen@vivo.com>
> ---
>
> Changes in v2:
> - Rewrite the subject.
> - Using umin() instead of min().
Sorry for not noticing this in my review of v1, but, looking at git
history, I think the prefix for the subject of this patch should be
"net: mvneta: " rather than "ethernet: "
Subject: net: mvneta: ...
--
pw-bot: cr
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-08-29 18:05 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-29 3:19 [PATCH v2 net-next] ethernet: marvell: Use min macro Yan Zhen
2024-08-29 18:05 ` Simon Horman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).