Search Linux Wireless

RE: [PATCH 03/24] rtw89: add core and trx files

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> -----Original Message-----
> From: Brian Norris [mailto:briannorris@xxxxxxxxxxxx]
> Sent: Friday, July 16, 2021 2:57 AM
> To: Pkshih
> Cc: kvalo@xxxxxxxxxxxxxx; linux-wireless@xxxxxxxxxxxxxxx
> Subject: Re: [PATCH 03/24] rtw89: add core and trx files
> 
> Hi,
> 
> On Fri, Jun 18, 2021 at 02:46:04PM +0800, Ping-Ke Shih wrote:
> > --- /dev/null
> > +++ b/drivers/net/wireless/realtek/rtw89/core.c
> > @@ -0,0 +1,2359 @@
> > +static void rtw89_traffic_stats_calc(struct rtw89_dev *rtwdev,
> > +				     struct rtw89_traffic_stats *stats)
> > +{
> ...
> > +	stats->tx_avg_len = (u32)(stats->tx_cnt ? stats->tx_unicast / stats->tx_cnt : 0);
> > +	stats->rx_avg_len = (u32)(stats->rx_cnt ? stats->rx_unicast / stats->rx_cnt : 0);
> 
> You're doing 64-bit division which isn't supported on all architectures.
> You need a do_div()-based solution here, like:
> 
> 	stats->tx_avg_len = stats->tx_cnt
> 			    ? DIV_ROUND_DOWN_ULL(stats->tx_unicast, stats->tx_cnt)
> 			    : 0;
> 	stats->rx_avg_len = stats->rx_cnt
> 			    ? DIV_ROUND_DOWN_ULL(stats->rx_unicast, stats->rx_cnt)
> 			    : 0;
> 

The kernel test robot has reported this on mips arch.
ERROR: modpost: "__udivdi3" [drivers/net/wireless/realtek/rtw89/rtw89_core.ko] undefined!

And, my fix is the same as yours. Next submission will include this.
Thank you.

--
Ping-Ke




[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux