netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next v2] rtase: Use min() instead of min_t()
@ 2025-04-25  6:34 Justin Lai
  2025-05-19 12:16 ` Justin Lai
  0 siblings, 1 reply; 5+ messages in thread
From: Justin Lai @ 2025-04-25  6:34 UTC (permalink / raw)
  To: kuba
  Cc: davem, edumazet, pabeni, andrew+netdev, linux-kernel, netdev,
	horms, pkshih, larry.chiu, Justin Lai, Joe Damato

Use min() instead of min_t() to avoid the possibility of casting to the
wrong type.

Signed-off-by: Justin Lai <justinlai0215@realtek.com>
Reviewed-by: Joe Damato <jdamato@fastly.com>
---
v1 -> v2:
- Remove the Fixes tag.
---
 drivers/net/ethernet/realtek/rtase/rtase_main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/realtek/rtase/rtase_main.c b/drivers/net/ethernet/realtek/rtase/rtase_main.c
index 6251548d50ff..8c902eaeb5ec 100644
--- a/drivers/net/ethernet/realtek/rtase/rtase_main.c
+++ b/drivers/net/ethernet/realtek/rtase/rtase_main.c
@@ -1983,7 +1983,7 @@ static u16 rtase_calc_time_mitigation(u32 time_us)
 	u8 msb, time_count, time_unit;
 	u16 int_miti;
 
-	time_us = min_t(int, time_us, RTASE_MITI_MAX_TIME);
+	time_us = min(time_us, RTASE_MITI_MAX_TIME);
 
 	msb = fls(time_us);
 	if (msb >= RTASE_MITI_COUNT_BIT_NUM) {
@@ -2005,7 +2005,7 @@ static u16 rtase_calc_packet_num_mitigation(u16 pkt_num)
 	u8 msb, pkt_num_count, pkt_num_unit;
 	u16 int_miti;
 
-	pkt_num = min_t(int, pkt_num, RTASE_MITI_MAX_PKT_NUM);
+	pkt_num = min(pkt_num, RTASE_MITI_MAX_PKT_NUM);
 
 	if (pkt_num > 60) {
 		pkt_num_unit = RTASE_MITI_MAX_PKT_NUM_IDX;
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* RE: [PATCH net-next v2] rtase: Use min() instead of min_t()
  2025-04-25  6:34 [PATCH net-next v2] rtase: Use min() instead of min_t() Justin Lai
@ 2025-05-19 12:16 ` Justin Lai
  2025-05-19 22:32   ` Jakub Kicinski
  0 siblings, 1 reply; 5+ messages in thread
From: Justin Lai @ 2025-05-19 12:16 UTC (permalink / raw)
  To: kuba@kernel.org
  Cc: davem@davemloft.net, edumazet@google.com, pabeni@redhat.com,
	andrew+netdev@lunn.ch, linux-kernel@vger.kernel.org,
	netdev@vger.kernel.org, horms@kernel.org, Ping-Ke Shih,
	Larry Chiu, Joe Damato

> -----Original Message-----
> From: Justin Lai <justinlai0215@realtek.com>
> Sent: Friday, April 25, 2025 2:34 PM
> To: kuba@kernel.org
> Cc: davem@davemloft.net; edumazet@google.com; pabeni@redhat.com;
> andrew+netdev@lunn.ch; linux-kernel@vger.kernel.org;
> netdev@vger.kernel.org; horms@kernel.org; Ping-Ke Shih
> <pkshih@realtek.com>; Larry Chiu <larry.chiu@realtek.com>; Justin Lai
> <justinlai0215@realtek.com>; Joe Damato <jdamato@fastly.com>
> Subject: [PATCH net-next v2] rtase: Use min() instead of min_t()
> 
> Use min() instead of min_t() to avoid the possibility of casting to the
> wrong type.
> 
> Signed-off-by: Justin Lai <justinlai0215@realtek.com>
> Reviewed-by: Joe Damato <jdamato@fastly.com>
> ---
> v1 -> v2:
> - Remove the Fixes tag.
> ---
>  drivers/net/ethernet/realtek/rtase/rtase_main.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/ethernet/realtek/rtase/rtase_main.c
> b/drivers/net/ethernet/realtek/rtase/rtase_main.c
> index 6251548d50ff..8c902eaeb5ec 100644
> --- a/drivers/net/ethernet/realtek/rtase/rtase_main.c
> +++ b/drivers/net/ethernet/realtek/rtase/rtase_main.c
> @@ -1983,7 +1983,7 @@ static u16 rtase_calc_time_mitigation(u32 time_us)
>  	u8 msb, time_count, time_unit;
>  	u16 int_miti;
> 
> -	time_us = min_t(int, time_us, RTASE_MITI_MAX_TIME);
> +	time_us = min(time_us, RTASE_MITI_MAX_TIME);
> 
>  	msb = fls(time_us);
>  	if (msb >= RTASE_MITI_COUNT_BIT_NUM) {
> @@ -2005,7 +2005,7 @@ static u16 rtase_calc_packet_num_mitigation(u16
> pkt_num)
>  	u8 msb, pkt_num_count, pkt_num_unit;
>  	u16 int_miti;
> 
> -	pkt_num = min_t(int, pkt_num, RTASE_MITI_MAX_PKT_NUM);
> +	pkt_num = min(pkt_num, RTASE_MITI_MAX_PKT_NUM);
> 
>  	if (pkt_num > 60) {
>  		pkt_num_unit = RTASE_MITI_MAX_PKT_NUM_IDX;
> --
> 2.34.1

Hi reviewers,

I apologize for the interruption, I would like to ask why this patch is
rejected on patchwork.

Justin

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH net-next v2] rtase: Use min() instead of min_t()
  2025-05-19 12:16 ` Justin Lai
@ 2025-05-19 22:32   ` Jakub Kicinski
  2025-05-19 22:38     ` Jakub Kicinski
  0 siblings, 1 reply; 5+ messages in thread
From: Jakub Kicinski @ 2025-05-19 22:32 UTC (permalink / raw)
  To: Justin Lai
  Cc: davem@davemloft.net, edumazet@google.com, pabeni@redhat.com,
	andrew+netdev@lunn.ch, linux-kernel@vger.kernel.org,
	netdev@vger.kernel.org, horms@kernel.org, Ping-Ke Shih,
	Larry Chiu, Joe Damato

On Mon, 19 May 2025 12:16:11 +0000 Justin Lai wrote:
> I apologize for the interruption, I would like to ask why this patch is
> rejected on patchwork.

Hm, unclear, sorry about that.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH net-next v2] rtase: Use min() instead of min_t()
  2025-05-19 22:32   ` Jakub Kicinski
@ 2025-05-19 22:38     ` Jakub Kicinski
  2025-05-20  3:19       ` Justin Lai
  0 siblings, 1 reply; 5+ messages in thread
From: Jakub Kicinski @ 2025-05-19 22:38 UTC (permalink / raw)
  To: Justin Lai
  Cc: davem@davemloft.net, edumazet@google.com, pabeni@redhat.com,
	andrew+netdev@lunn.ch, linux-kernel@vger.kernel.org,
	netdev@vger.kernel.org, horms@kernel.org, Ping-Ke Shih,
	Larry Chiu, Joe Damato

On Mon, 19 May 2025 15:32:18 -0700 Jakub Kicinski wrote:
> On Mon, 19 May 2025 12:16:11 +0000 Justin Lai wrote:
> > I apologize for the interruption, I would like to ask why this patch is
> > rejected on patchwork.  
> 
> Hm, unclear, sorry about that.

It doesn't apply, perhaps that's why? Please rebase and repost.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: [PATCH net-next v2] rtase: Use min() instead of min_t()
  2025-05-19 22:38     ` Jakub Kicinski
@ 2025-05-20  3:19       ` Justin Lai
  0 siblings, 0 replies; 5+ messages in thread
From: Justin Lai @ 2025-05-20  3:19 UTC (permalink / raw)
  To: Jakub Kicinski
  Cc: davem@davemloft.net, edumazet@google.com, pabeni@redhat.com,
	andrew+netdev@lunn.ch, linux-kernel@vger.kernel.org,
	netdev@vger.kernel.org, horms@kernel.org, Ping-Ke Shih,
	Larry Chiu, Joe Damato

> On Mon, 19 May 2025 15:32:18 -0700 Jakub Kicinski wrote:
> > On Mon, 19 May 2025 12:16:11 +0000 Justin Lai wrote:
> > > I apologize for the interruption, I would like to ask why this patch
> > > is rejected on patchwork.
> >
> > Hm, unclear, sorry about that.
> 
> It doesn't apply, perhaps that's why? Please rebase and repost.

Hi Jakub,

Thank you for your reply. I will rebase and repost.

Thanks,
Justin

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-05-20  3:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-25  6:34 [PATCH net-next v2] rtase: Use min() instead of min_t() Justin Lai
2025-05-19 12:16 ` Justin Lai
2025-05-19 22:32   ` Jakub Kicinski
2025-05-19 22:38     ` Jakub Kicinski
2025-05-20  3:19       ` Justin Lai

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).