rocker: Simplify the calculation of variables
authorJiapeng Zhong <abaci-bugfix@linux.alibaba.com>
Tue, 26 Jan 2021 08:13:03 +0000 (16:13 +0800)
committerJakub Kicinski <kuba@kernel.org>
Thu, 28 Jan 2021 01:35:48 +0000 (17:35 -0800)
Fix the following coccicheck warnings:

./drivers/net/ethernet/rocker/rocker_ofdpa.c:926:34-36: WARNING !A || A
&& B is equivalent to !A || B.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Zhong <abaci-bugfix@linux.alibaba.com>
Link: https://lore.kernel.org/r/1611648783-3916-1-git-send-email-abaci-bugfix@linux.alibaba.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/rocker/rocker_ofdpa.c

index d067da1ef070664b5e49495b06c72f2d73c7c9b0..967a634ee9ac1b2e88c454f5b290bbc7482e09ee 100644 (file)
@@ -923,7 +923,7 @@ static int ofdpa_flow_tbl_bridge(struct ofdpa_port *ofdpa_port,
        struct ofdpa_flow_tbl_entry *entry;
        u32 priority;
        bool vlan_bridging = !!vlan_id;
-       bool dflt = !eth_dst || (eth_dst && eth_dst_mask);
+       bool dflt = !eth_dst || eth_dst_mask;
        bool wild = false;
 
        entry = kzalloc(sizeof(*entry), GFP_ATOMIC);