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]
Date:   Sat, 6 Apr 2019 20:11:55 +1100
From:   Julian Calaby <julian.calaby@...il.com>
To:     Nicholas Mc Guire <hofrat@...dl.org>
Cc:     Adham Abozaeid <adham.abozaeid@...rochip.com>,
        Ajay Singh <ajay.kathat@...rochip.com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        linux-wireless@...r.kernel.org, devel@...verdev.osuosl.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH V2] staging: wilc1000: drop explicit conversion to bool

Hi Nicholas,

On Sat, Apr 6, 2019 at 7:48 PM Nicholas Mc Guire <hofrat@...dl.org> wrote:
>
> As the expression evaluates to a boolean anyway (relational and logical
> operators) conversion with the ternary operator is not needed here as
> coccinelle notes (boolconv.cocci)
>
> Signed-off-by: Nicholas Mc Guire <hofrat@...dl.org>
> ---
>
> V2: sent out the wrong version - the commit message was longer than 75
>     chars - only change here is the commit message wrapping.
>
> scripts/coccinelle/misc/boolconv.cocci warned about:
> drivers/staging/wilc1000/wilc_wlan.c:14:48-53: WARNING: conversion to bool not needed here
>
> Patch was compile tested with: x86_64_defconfig + Staging=y,
> WILC1000_SDIO=m, WILC1000_SPI=m, WILC1000=m
> (checkpatch, sparse and cocci clean otherwise)
>
> Patch is against 5.1-rc3 (localversion-next is -next-20190403)
>
>  drivers/staging/wilc1000/wilc_wlan.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c
> index c238969..6c9fd3a 100644
> --- a/drivers/staging/wilc1000/wilc_wlan.c
> +++ b/drivers/staging/wilc1000/wilc_wlan.c
> @@ -11,7 +11,7 @@
>
>  static inline bool is_wilc1000(u32 id)
>  {
> -       return ((id & 0xfffff000) == 0x100000 ? true : false);
> +       return ((id & 0xfffff000) == 0x100000);

Whilst you're here, you might as well remove the superfluous parentheses.

Other than that,

Reviewed-by: Julian Calaby <julian.calaby@...il.com>

Thanks,

-- 
Julian Calaby

Email: julian.calaby@...il.com
Profile: http://www.google.com/profiles/julian.calaby/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ