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: <20190603190457.GA6487@kroah.com>
Date:   Mon, 3 Jun 2019 21:04:57 +0200
From:   Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To:     Hariprasad Kelam <hariprasad.kelam@...il.com>
Cc:     Carmeli Tamir <carmeli.tamir@...il.com>,
        Nishad Kamdar <nishadkamdar@...il.com>,
        devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] Staging: emxx_udc: fix warning "sum of probable
 bitmasks, consider |"

On Tue, Jun 04, 2019 at 12:24:12AM +0530, Hariprasad Kelam wrote:
> Knowing the fact that operator '|' is faster than '+'.
> Its better we replace + with | in this case.
> 
> Issue reported by coccicheck
> drivers/staging/emxx_udc/emxx_udc.h:94:34-35: WARNING: sum of probable
> bitmasks, consider |
> 
> Signed-off-by: Hariprasad Kelam <hariprasad.kelam@...il.com>
> ---
>  drivers/staging/emxx_udc/emxx_udc.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/emxx_udc/emxx_udc.h b/drivers/staging/emxx_udc/emxx_udc.h
> index b8c3dee..88d6bda 100644
> --- a/drivers/staging/emxx_udc/emxx_udc.h
> +++ b/drivers/staging/emxx_udc/emxx_udc.h
> @@ -91,7 +91,7 @@ int vbus_irq;
>  #define BIT30		0x40000000
>  #define BIT31		0x80000000

All of those BITXX defines should be removed and the "real" BIT(X) macro
used instead.

> -#define TEST_FORCE_ENABLE		(BIT18 + BIT16)
> +#define TEST_FORCE_ENABLE		(BIT18 | BIT16)

It really doesn't matter, a good compiler will have already turned this
into a constant value so you really do not know if this is less/faster
code or not, right?

Did you look at the output to verify this actually changed anything?

thanks,

greg k-h

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ