netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net 0/3] Fix kernel test robot issue and type error in min_t
@ 2025-04-15 12:21 Justin Lai
  2025-04-15 12:21 ` [PATCH net 1/3] rtase: Fix the compile error reported by the kernel test robot Justin Lai
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Justin Lai @ 2025-04-15 12:21 UTC (permalink / raw)
  To: kuba
  Cc: davem, edumazet, pabeni, andrew+netdev, linux-kernel, netdev,
	horms, pkshih, larry.chiu, Justin Lai

This patch set mainly involves fixing the kernel test robot issue and
the type error in min_t.
Details are as follows:
1. Fix the compile error reported by the kernel test robot
2. Fix the compile warning reported by the kernel test robot
3. Fix a type error in min_t

Justin Lai (3):
  rtase: Fix the compile error reported by the kernel test robot
  rtase: Fix the compile warning reported by the kernel test robot
  rtase: Fix a type error in min_t

 drivers/net/ethernet/realtek/rtase/rtase.h      | 2 +-
 drivers/net/ethernet/realtek/rtase/rtase_main.c | 8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

-- 
2.34.1


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

* [PATCH net 1/3] rtase: Fix the compile error reported by the kernel test robot
  2025-04-15 12:21 [PATCH net 0/3] Fix kernel test robot issue and type error in min_t Justin Lai
@ 2025-04-15 12:21 ` Justin Lai
  2025-04-15 12:21 ` [PATCH net 2/3] rtase: Fix the compile warning " Justin Lai
  2025-04-15 12:41 ` [PATCH net 0/3] Fix kernel test robot issue and type error in min_t Justin Lai
  2 siblings, 0 replies; 4+ messages in thread
From: Justin Lai @ 2025-04-15 12:21 UTC (permalink / raw)
  To: kuba
  Cc: davem, edumazet, pabeni, andrew+netdev, linux-kernel, netdev,
	horms, pkshih, larry.chiu, Justin Lai, kernel test robot

Fix the following compile error reported by the kernel test
robot by modifying the condition used to detect overflow in
rtase_calc_time_mitigation.

In file included from include/linux/mdio.h:10:0,
                  from drivers/net/ethernet/realtek/rtase/rtase_main.c:58:
 In function 'u16_encode_bits',
     inlined from 'rtase_calc_time_mitigation.constprop' at drivers/net/
     ethernet/realtek/rtase/rtase_main.c:1915:13,
     inlined from 'rtase_init_software_variable.isra.41' at drivers/net/
     ethernet/realtek/rtase/rtase_main.c:1961:13,
     inlined from 'rtase_init_one' at drivers/net/ethernet/realtek/
     rtase/rtase_main.c:2111:2:
>> include/linux/bitfield.h:178:3: error: call to '__field_overflow'
      declared with attribute error: value doesn't fit into mask
    __field_overflow();     \
    ^~~~~~~~~~~~~~~~~~
 include/linux/bitfield.h:198:2: note: in expansion of macro
 '____MAKE_OP'
   ____MAKE_OP(u##size,u##size,,)
   ^~~~~~~~~~~
 include/linux/bitfield.h:200:1: note: in expansion of macro
 '__MAKE_OP'
  __MAKE_OP(16)
  ^~~~~~~~~

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_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 2aacc1996796..55b8d3666153 100644
--- a/drivers/net/ethernet/realtek/rtase/rtase_main.c
+++ b/drivers/net/ethernet/realtek/rtase/rtase_main.c
@@ -1925,8 +1925,8 @@ static u16 rtase_calc_time_mitigation(u32 time_us)
 
 	time_us = min_t(int, 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 {
-- 
2.34.1


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

* [PATCH net 2/3] rtase: Fix the compile warning reported by the kernel test robot
  2025-04-15 12:21 [PATCH net 0/3] Fix kernel test robot issue and type error in min_t Justin Lai
  2025-04-15 12:21 ` [PATCH net 1/3] rtase: Fix the compile error reported by the kernel test robot Justin Lai
@ 2025-04-15 12:21 ` Justin Lai
  2025-04-15 12:41 ` [PATCH net 0/3] Fix kernel test robot issue and type error in min_t Justin Lai
  2 siblings, 0 replies; 4+ messages in thread
From: Justin Lai @ 2025-04-15 12:21 UTC (permalink / raw)
  To: kuba
  Cc: davem, edumazet, pabeni, andrew+netdev, linux-kernel, netdev,
	horms, pkshih, larry.chiu, Justin Lai, kernel test robot

Fix the following compile warning reported by the kernel test robot by
increasing the size of ivec->name.

drivers/net/ethernet/realtek/rtase/rtase_main.c: In function 'rtase_open':
>> drivers/net/ethernet/realtek/rtase/rtase_main.c:1117:52: warning:
'%i' directive output may be truncated writing between 1 and 10 bytes
into a region of size between 7 and 22 [-Wformat-truncation=]
     snprintf(ivec->name, sizeof(ivec->name), "%s_int%i",
                                                     ^~
 drivers/net/ethernet/realtek/rtase/rtase_main.c:1117:45: note:
 directive argument in the range [0, 2147483647]
     snprintf(ivec->name, sizeof(ivec->name), "%s_int%i",
                                              ^~~~~~~~~~
 drivers/net/ethernet/realtek/rtase/rtase_main.c:1117:4: note:
 'snprintf' output between 6 and 30 bytes into a destination of
 size 26
     snprintf(ivec->name, sizeof(ivec->name), "%s_int%i",
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       tp->dev->name, i);
       ~~~~~~~~~~~~~~~~~

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 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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;
-- 
2.34.1


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

* RE: [PATCH net 0/3] Fix kernel test robot issue and type error in min_t
  2025-04-15 12:21 [PATCH net 0/3] Fix kernel test robot issue and type error in min_t Justin Lai
  2025-04-15 12:21 ` [PATCH net 1/3] rtase: Fix the compile error reported by the kernel test robot Justin Lai
  2025-04-15 12:21 ` [PATCH net 2/3] rtase: Fix the compile warning " Justin Lai
@ 2025-04-15 12:41 ` Justin Lai
  2 siblings, 0 replies; 4+ messages in thread
From: Justin Lai @ 2025-04-15 12:41 UTC (permalink / raw)
  To: Justin Lai, 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



> -----Original Message-----
> From: Justin Lai <justinlai0215@realtek.com>
> Sent: Tuesday, April 15, 2025 8:22 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>
> Subject: [PATCH net 0/3] Fix kernel test robot issue and type error in min_t
> 
> This patch set mainly involves fixing the kernel test robot issue and the type
> error in min_t.
> Details are as follows:
> 1. Fix the compile error reported by the kernel test robot 2. Fix the compile
> warning reported by the kernel test robot 3. Fix a type error in min_t
> 
> Justin Lai (3):
>   rtase: Fix the compile error reported by the kernel test robot
>   rtase: Fix the compile warning reported by the kernel test robot
>   rtase: Fix a type error in min_t
> 
>  drivers/net/ethernet/realtek/rtase/rtase.h      | 2 +-
>  drivers/net/ethernet/realtek/rtase/rtase_main.c | 8 ++++----
>  2 files changed, 5 insertions(+), 5 deletions(-)
> 
> --
> 2.34.1
> 

Sorry, this patch set was posted incompletely. I will post it again in
24 hours.

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

end of thread, other threads:[~2025-04-15 12:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-15 12:21 [PATCH net 0/3] Fix kernel test robot issue and type error in min_t Justin Lai
2025-04-15 12:21 ` [PATCH net 1/3] rtase: Fix the compile error reported by the kernel test robot Justin Lai
2025-04-15 12:21 ` [PATCH net 2/3] rtase: Fix the compile warning " Justin Lai
2025-04-15 12:41 ` [PATCH net 0/3] Fix kernel test robot issue and type error in min_t 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).