* [PATCH net] rtase: Fix kernel test robot issue
@ 2025-04-14 9:36 Justin Lai
2025-04-14 12:24 ` Andrew Lunn
0 siblings, 1 reply; 3+ messages in thread
From: Justin Lai @ 2025-04-14 9:36 UTC (permalink / raw)
To: kuba
Cc: davem, edumazet, pabeni, andrew+netdev, linux-kernel, netdev,
horms, pkshih, larry.chiu, Justin Lai, kernel test robot
1. Fix the compile error reported by the kernel test robot by modifying
the condition used to detect overflow in rtase_calc_time_mitigation.
2. Fix the compile warning reported by the kernel test robot by
increasing the size of ivec->name.
3. Fix a type error in min_t.
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202503182158.nkAlbJWX-lkp@intel.com/
Fixes: a36e9f5cfe9e ("rtase: Add support for a pci table in this module")
Signed-off-by: Justin Lai <justinlai0215@realtek.com>
---
drivers/net/ethernet/realtek/rtase/rtase.h | 2 +-
drivers/net/ethernet/realtek/rtase/rtase_main.c | 8 ++++----
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/net/ethernet/realtek/rtase/rtase.h b/drivers/net/ethernet/realtek/rtase/rtase.h
index 2bbfcad613ab..1e63b5826da1 100644
--- a/drivers/net/ethernet/realtek/rtase/rtase.h
+++ b/drivers/net/ethernet/realtek/rtase/rtase.h
@@ -259,7 +259,7 @@ union rtase_rx_desc {
#define RTASE_VLAN_TAG_MASK GENMASK(15, 0)
#define RTASE_RX_PKT_SIZE_MASK GENMASK(13, 0)
-#define RTASE_IVEC_NAME_SIZE (IFNAMSIZ + 10)
+#define RTASE_IVEC_NAME_SIZE (IFNAMSIZ + 14)
struct rtase_int_vector {
struct rtase_private *tp;
diff --git a/drivers/net/ethernet/realtek/rtase/rtase_main.c b/drivers/net/ethernet/realtek/rtase/rtase_main.c
index 2aacc1996796..bc856fb3d6f3 100644
--- a/drivers/net/ethernet/realtek/rtase/rtase_main.c
+++ b/drivers/net/ethernet/realtek/rtase/rtase_main.c
@@ -1923,10 +1923,10 @@ 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_t(u32, time_us, RTASE_MITI_MAX_TIME);
- msb = fls(time_us);
- if (msb >= RTASE_MITI_COUNT_BIT_NUM) {
+ if (time_us > RTASE_MITI_TIME_COUNT_MASK) {
+ msb = fls(time_us);
time_unit = msb - RTASE_MITI_COUNT_BIT_NUM;
time_count = time_us >> (msb - RTASE_MITI_COUNT_BIT_NUM);
} else {
@@ -1945,7 +1945,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_t(u16, 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 [flat|nested] 3+ messages in thread
* Re: [PATCH net] rtase: Fix kernel test robot issue
2025-04-14 9:36 [PATCH net] rtase: Fix kernel test robot issue Justin Lai
@ 2025-04-14 12:24 ` Andrew Lunn
2025-04-15 3:57 ` Justin Lai
0 siblings, 1 reply; 3+ messages in thread
From: Andrew Lunn @ 2025-04-14 12:24 UTC (permalink / raw)
To: Justin Lai
Cc: kuba, davem, edumazet, pabeni, andrew+netdev, linux-kernel,
netdev, horms, pkshih, larry.chiu, kernel test robot
On Mon, Apr 14, 2025 at 05:36:45PM +0800, Justin Lai wrote:
> 1. Fix the compile error reported by the kernel test robot by modifying
> the condition used to detect overflow in rtase_calc_time_mitigation.
> 2. Fix the compile warning reported by the kernel test robot by
> increasing the size of ivec->name.
> 3. Fix a type error in min_t.
Looks like three patches should be used, not one. You can then include
the details of what the test robot reported making it easier to
understand each fix.
Andrew
---
pw-bot: cr
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: [PATCH net] rtase: Fix kernel test robot issue
2025-04-14 12:24 ` Andrew Lunn
@ 2025-04-15 3:57 ` Justin Lai
0 siblings, 0 replies; 3+ messages in thread
From: Justin Lai @ 2025-04-15 3:57 UTC (permalink / raw)
To: Andrew Lunn
Cc: kuba, davem, edumazet, pabeni, andrew+netdev, linux-kernel,
netdev, horms, Ping-Ke Shih, Larry Chiu, kernel test robot
> On Mon, Apr 14, 2025 at 05:36:45PM +0800, Justin Lai wrote:
> > 1. Fix the compile error reported by the kernel test robot by modifying
> > the condition used to detect overflow in rtase_calc_time_mitigation.
> > 2. Fix the compile warning reported by the kernel test robot by
> > increasing the size of ivec->name.
> > 3. Fix a type error in min_t.
>
> Looks like three patches should be used, not one. You can then include
> the details of what the test robot reported making it easier to
> understand each fix.
>
>
> Andrew
>
> ---
> pw-bot: cr
Hi Andrew,
Thank you for your response. I will split this patch into three
separate patches and include the detailed report from the kernel
test robot.
Thanks,
Justin
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-04-15 3:58 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-04-14 9:36 [PATCH net] rtase: Fix kernel test robot issue Justin Lai
2025-04-14 12:24 ` Andrew Lunn
2025-04-15 3:57 ` Justin Lai
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®