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] [day] [month] [year] [list]
Date:   Tue, 11 Sep 2018 14:38:41 -0700
From:   Nick Desaulniers <ndesaulniers@...gle.com>
To:     Nathan Chancellor <natechancellor@...il.com>
Cc:     mark@...heh.com, jlbec@...lplan.org, ocfs2-devel@....oracle.com,
        LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] ocfs2/dlm: Remove unnecessary parentheses

On Tue, Sep 11, 2018 at 2:35 PM Nathan Chancellor
<natechancellor@...il.com> wrote:
>
> Clang warns when more than one set of parentheses is used for a
> single conditional statement:
>
> fs/ocfs2/dlm/dlmthread.c:534:18: warning: equality comparison with extraneous
>       parentheses [-Wparentheses-equality]
>         if ((res->owner == dlm->node_num)) {
>              ~~~~~~~~~~~^~~~~~~~~~~~~~~~
> fs/ocfs2/dlm/dlmthread.c:534:18: note: remove extraneous parentheses around the
>       comparison to silence this warning
>         if ((res->owner == dlm->node_num)) {
>             ~           ^               ~
>
> Reported-by: Nick Desaulniers <ndesaulniers@...gle.com>
> Signed-off-by: Nathan Chancellor <natechancellor@...il.com>
> ---
>  fs/ocfs2/dlm/dlmthread.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/ocfs2/dlm/dlmthread.c b/fs/ocfs2/dlm/dlmthread.c
> index 838a06d4066a..074d5de17bb2 100644
> --- a/fs/ocfs2/dlm/dlmthread.c
> +++ b/fs/ocfs2/dlm/dlmthread.c
> @@ -531,7 +531,7 @@ void __dlm_dirty_lockres(struct dlm_ctxt *dlm, struct dlm_lock_resource *res)
>         assert_spin_locked(&res->spinlock);
>
>         /* don't shuffle secondary queues */
> -       if ((res->owner == dlm->node_num)) {
> +       if (res->owner == dlm->node_num) {
>                 if (res->state & (DLM_LOCK_RES_MIGRATING |
>                                   DLM_LOCK_RES_BLOCK_DIRTY))
>                     return;
> --
> 2.18.0
>

Thanks for the simple fix, Nathan.

Reviewed-by: Nick Desaulniers <ndesaulniers@...gle.com>
-- 
Thanks,
~Nick Desaulniers

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ