lkml.org 
[lkml]   [2021]   [Nov]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH -next v2] ethernet: renesas: Use div64_ul instead of do_div
From
On 18.11.2021 12:48, Yang Li wrote:

> do_div() does a 64-by-32 division. Here the divisor is an
> unsigned long which on some platforms is 64 bit wide. So use
> div64_ul instead of do_div to avoid a possible truncation.
>
> Eliminate the following coccicheck warning:
> ./drivers/net/ethernet/renesas/ravb_main.c:2492:1-7: WARNING:
> do_div() does a 64-by-32 division, please consider using div64_ul
> instead.
>
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
> Reviewed-by: Sergey Shtylyov <s.shtylyov@omp.ru>

I haven't given you this tag, yet I was going to give you one, so
it's OK finally. :-)

[...]

MBR, Sergey

\
 
 \ /
  Last update: 2021-11-18 11:08    [W:0.031 / U:0.360 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site