Skip to content

Commit 68f9d89

Browse files
Justin Laikuba-moo
Justin Lai
authored andcommitted
rtase: Modify the condition used to detect overflow in rtase_calc_time_mitigation
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 <[email protected]> Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/ Fixes: a36e9f5 ("rtase: Add support for a pci table in this module") Signed-off-by: Justin Lai <[email protected]> Reviewed-by: Simon Horman <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 8f7ae5a commit 68f9d89

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/net/ethernet/realtek/rtase/rtase_main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1925,8 +1925,8 @@ static u16 rtase_calc_time_mitigation(u32 time_us)
19251925

19261926
time_us = min_t(int, time_us, RTASE_MITI_MAX_TIME);
19271927

1928-
msb = fls(time_us);
1929-
if (msb >= RTASE_MITI_COUNT_BIT_NUM) {
1928+
if (time_us > RTASE_MITI_TIME_COUNT_MASK) {
1929+
msb = fls(time_us);
19301930
time_unit = msb - RTASE_MITI_COUNT_BIT_NUM;
19311931
time_count = time_us >> (msb - RTASE_MITI_COUNT_BIT_NUM);
19321932
} else {

0 commit comments

Comments
 (0)