On 11/3/22 13:07, Randy Dunlap wrote:
FYI: When CONFIG_HZ=24 (arch/mips/): ../drivers/staging/rtl8192e/rtllib_wx.c: In function 'rtl819x_translate_scan': ../drivers/staging/rtl8192e/rtllib_wx.c:220:57: warning: division by zero [-Wdiv-by-zero] 220 | (jiffies - network->last_scanned) / (HZ / 100)); | ^ In file included from ../include/linux/skbuff.h:45, from ../include/linux/if_ether.h:19, from ../include/linux/etherdevice.h:20, from ../drivers/staging/rtl8192e/rtllib_wx.c:18: ../drivers/staging/rtl8192e/rtllib_wx.c: In function 'rtllib_wx_get_scan': ../drivers/staging/rtl8192e/rtllib_wx.c:261:70: warning: division by zero [-Wdiv-by-zero] 261 | (jiffies - network->last_scanned) / |
That statement is messed up. Does the attached patch fix it? Larry
diff --git a/drivers/staging/rtl8192e/rtllib_wx.c b/drivers/staging/rtl8192e/rtllib_wx.c index da2c41c9b92f..0a007f55f988 100644 --- a/drivers/staging/rtl8192e/rtllib_wx.c +++ b/drivers/staging/rtl8192e/rtllib_wx.c @@ -216,8 +216,8 @@ static inline char *rtl819x_translate_scan(struct rtllib_device *ieee, iwe.cmd = IWEVCUSTOM; p = custom; p += scnprintf(p, MAX_CUSTOM_LEN - (p - custom), - " Last beacon: %lums ago", - (jiffies - network->last_scanned) / (HZ / 100)); + " Last beacon: %lus ago", + (jiffies - network->last_scanned) / HZ); iwe.u.data.length = p - custom; if (iwe.u.data.length) start = iwe_stream_add_point_rsl(info, start, stop,