Commit 18c955b7 authored by Nathan Chancellor's avatar Nathan Chancellor Committed by David S. Miller

bonding: Remove extraneous parentheses in bond_setup

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: 18cb261a ("bonding: support hardware encryption offload to slaves")
Link: https://github.com/ClangBuiltLinux/linux/issues/1066Signed-off-by: default avatarNathan Chancellor <natechancellor@gmail.com>
Reported-by: default avatarkernelci.org bot <bot@kernelci.org>
Reviewed-by: default avatarNick Desaulniers <ndesaulniers@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 52660c0e
...@@ -4654,7 +4654,7 @@ void bond_setup(struct net_device *bond_dev) ...@@ -4654,7 +4654,7 @@ void bond_setup(struct net_device *bond_dev)
#ifdef CONFIG_XFRM_OFFLOAD #ifdef CONFIG_XFRM_OFFLOAD
/* set up xfrm device ops (only supported in active-backup right now) */ /* set up xfrm device ops (only supported in active-backup right now) */
if ((BOND_MODE(bond) == BOND_MODE_ACTIVEBACKUP)) if (BOND_MODE(bond) == BOND_MODE_ACTIVEBACKUP)
bond_dev->xfrmdev_ops = &bond_xfrmdev_ops; bond_dev->xfrmdev_ops = &bond_xfrmdev_ops;
bond->xs = NULL; bond->xs = NULL;
#endif /* CONFIG_XFRM_OFFLOAD */ #endif /* CONFIG_XFRM_OFFLOAD */
...@@ -4678,7 +4678,7 @@ void bond_setup(struct net_device *bond_dev) ...@@ -4678,7 +4678,7 @@ void bond_setup(struct net_device *bond_dev)
bond_dev->hw_features |= NETIF_F_GSO_ENCAP_ALL | NETIF_F_GSO_UDP_L4; bond_dev->hw_features |= NETIF_F_GSO_ENCAP_ALL | NETIF_F_GSO_UDP_L4;
#ifdef CONFIG_XFRM_OFFLOAD #ifdef CONFIG_XFRM_OFFLOAD
if ((BOND_MODE(bond) == BOND_MODE_ACTIVEBACKUP)) if (BOND_MODE(bond) == BOND_MODE_ACTIVEBACKUP)
bond_dev->hw_features |= BOND_XFRM_FEATURES; bond_dev->hw_features |= BOND_XFRM_FEATURES;
#endif /* CONFIG_XFRM_OFFLOAD */ #endif /* CONFIG_XFRM_OFFLOAD */
bond_dev->features |= bond_dev->hw_features; bond_dev->features |= bond_dev->hw_features;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment