Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

-Wparentheses-equality in drivers/net/bonding/bond_main.c #1066

Closed
nathanchance opened this issue Jun 26, 2020 · 1 comment
Closed

-Wparentheses-equality in drivers/net/bonding/bond_main.c #1066

nathanchance opened this issue Jun 26, 2020 · 1 comment
Assignees
Labels
-Wparentheses-equality [BUG] linux-next This is an issue only seen in linux-next [FIXED][LINUX] development cycle This bug was only present and fixed in a -next or -rc cycle

Comments

@nathanchance
Copy link
Member

drivers/net/bonding/bond_main.c:4657:23: warning: equality comparison with extraneous parentheses [-Wparentheses-equality]
        if ((BOND_MODE(bond) == BOND_MODE_ACTIVEBACKUP))
             ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/bonding/bond_main.c:4657:23: note: remove extraneous parentheses around the comparison to silence this warning
        if ((BOND_MODE(bond) == BOND_MODE_ACTIVEBACKUP))
            ~                ^                        ~
drivers/net/bonding/bond_main.c:4657:23: note: use '=' to turn this equality comparison into an assignment
        if ((BOND_MODE(bond) == BOND_MODE_ACTIVEBACKUP))
                             ^~
                             =
drivers/net/bonding/bond_main.c:4681:23: warning: equality comparison with extraneous parentheses [-Wparentheses-equality]
        if ((BOND_MODE(bond) == BOND_MODE_ACTIVEBACKUP))
             ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/bonding/bond_main.c:4681:23: note: remove extraneous parentheses around the comparison to silence this warning
        if ((BOND_MODE(bond) == BOND_MODE_ACTIVEBACKUP))
            ~                ^                        ~
drivers/net/bonding/bond_main.c:4681:23: note: use '=' to turn this equality comparison into an assignment
        if ((BOND_MODE(bond) == BOND_MODE_ACTIVEBACKUP))
                             ^~
                             =
2 warnings generated.

Patch submitted: https://lore.kernel.org/netdev/20200626041001.1194928-1-natechancellor@gmail.com/

@nathanchance nathanchance added -Wparentheses-equality [PATCH] Submitted A patch has been submitted for review [BUG] linux-next This is an issue only seen in linux-next labels Jun 26, 2020
@nathanchance nathanchance self-assigned this Jun 26, 2020
fengguang pushed a commit to 0day-ci/linux that referenced this issue Jun 26, 2020
Clang warns:

drivers/net/bonding/bond_main.c:4657:23: warning: equality comparison
with extraneous parentheses [-Wparentheses-equality]
        if ((BOND_MODE(bond) == BOND_MODE_ACTIVEBACKUP))
             ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~

drivers/net/bonding/bond_main.c:4681:23: warning: equality comparison
with extraneous parentheses [-Wparentheses-equality]
        if ((BOND_MODE(bond) == BOND_MODE_ACTIVEBACKUP))
             ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~

This warning occurs when a comparision has two sets of parentheses,
which is usually the convention for doing an assignment within an
if statement. Since equality comparisons do not need a second set of
parentheses, remove them to fix the warning.

Fixes: 18cb261 ("bonding: support hardware encryption offload to slaves")
Link: ClangBuiltLinux#1066
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
fengguang pushed a commit to 0day-ci/linux that referenced this issue Jun 26, 2020
Clang warns:

drivers/net/bonding/bond_main.c:4657:23: warning: equality comparison
with extraneous parentheses [-Wparentheses-equality]
        if ((BOND_MODE(bond) == BOND_MODE_ACTIVEBACKUP))
             ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~

drivers/net/bonding/bond_main.c:4681:23: warning: equality comparison
with extraneous parentheses [-Wparentheses-equality]
        if ((BOND_MODE(bond) == BOND_MODE_ACTIVEBACKUP))
             ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~

This warning occurs when a comparision has two sets of parentheses,
which is usually the convention for doing an assignment within an
if statement. Since equality comparisons do not need a second set of
parentheses, remove them to fix the warning.

Fixes: 18cb261 ("bonding: support hardware encryption offload to slaves")
Link: ClangBuiltLinux#1066
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Reported-by: kernelci.org bot <bot@kernelci.org>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
@nathanchance
Copy link
Member Author

@nathanchance nathanchance added [FIXED][LINUX] development cycle This bug was only present and fixed in a -next or -rc cycle and removed [PATCH] Submitted A patch has been submitted for review labels Jun 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
-Wparentheses-equality [BUG] linux-next This is an issue only seen in linux-next [FIXED][LINUX] development cycle This bug was only present and fixed in a -next or -rc cycle
Projects
None yet
Development

No branches or pull requests

1 participant