lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9c66a3d0-9c2a-c9dc-b3e1-d7e9ea12e402@cogentembedded.com>
Date:   Fri, 24 Aug 2018 12:03:17 +0300
From:   Sergei Shtylyov <sergei.shtylyov@...entembedded.com>
To:     Jeff Kirsher <jeffrey.t.kirsher@...el.com>, davem@...emloft.net
Cc:     Jacob Keller <jacob.e.keller@...el.com>, netdev@...r.kernel.org,
        nhorman@...hat.com, sassmann@...hat.com, jogreene@...hat.com,
        Anirudh Venkataramanan <anirudh.venkataramanan@...el.com>
Subject: Re: [net 07/13] ice: Use order_base_2 to calculate higher power of 2

Hello!

On 8/23/2018 10:14 PM, Jeff Kirsher wrote:

> From: Jacob Keller <jacob.e.keller@...el.com>
> 
> Currently, we use a combination of ilog2 and is_power_of_2() to
> calculate the next power of 2 for the qcount. This appears to be causing
> a warning on some combinations of GCC and the Linux kernel:
> 
> MODPOST 1 modules
> WARNING: "____ilog2_NaN" [ice.ko] undefined!
> 
> This appears to because because GCC realizes that qcount could be zero

    One "because" is enough. :-)

> in some circumstances and thus attempts to link against the
> intentionally undefined ___ilog2_NaN function.
> 
> The order_base_2 function is intentionally defined to return 0 when
> passed 0 as an argument, and thus will be safe to use here.
> 
> This not only fixes the warning but makes the resulting code slightly
> cleaner, and is really what we should have used originally.
> 
> Also update the comment to make it more clear that we are rounding up,
> not just incrementing the ilog2 of qcount unconditionally.
> 
> Signed-off-by: Jacob Keller <jacob.e.keller@...el.com>
> Signed-off-by: Anirudh Venkataramanan <anirudh.venkataramanan@...el.com>
> Tested-by: Tony Brelinski <tonyx.brelinski@...el.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@...el.com>
[...]

MBR, Sergei

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ