Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp1444474rwn; Thu, 8 Sep 2022 20:51:26 -0700 (PDT) X-Google-Smtp-Source: AA6agR77SFMQgVxuIY6wX/2XV521wYzC8Zl6H2ELhWq9cod4wPK5F4vCrnVd/zlKZX8lhrAaSt9Y X-Received: by 2002:a05:6512:2313:b0:48a:e615:289b with SMTP id o19-20020a056512231300b0048ae615289bmr3531851lfu.201.1662695486186; Thu, 08 Sep 2022 20:51:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662695486; cv=none; d=google.com; s=arc-20160816; b=Nd1a+Td8Db0YSZqM8Wd2YiJPUbYzfGoK6+GDKPWQ5kHjrlbv9pQtC/yiVUs/PM7wUr Kl2bLlibiQvJ/q4lqi8JFEh5hjL+TJN5fWtb2aJp57lyg0JUYrtQdn/JqWe3WPaMwxmq C9KDcYVJB1nQZRzJAAMBKaT9TA94cZ9js7665KZxmpDT1bYLtjqnB+5PN/EF1/p22egH RRNIFzOJQfB7O2ZirPVUUI/IOpYJTKRKbQXKu1X21kNk6rKMSJKPybYYrCzpMM5ZGgWc /LHLKrNNiGbmduMV/L97U8NGEaDnf7xvwdRDIeAPScvyNPsO5UEDEo/3TTwPMGHLXJQf uJLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=O8wX2najd2+vC/WkGGO+At8XTNtL1wuFDQmsllHgfMg=; b=WgoNLb1juXRC6US7ZGQ6cfaTjfgAGMmq/2bQhV8qLEw7lKr6Qr2t2QlzWPpimX+jfZ 4LfL9bSce5ONYzc026sk24ri004bvw6IGku0bAe2RUIKaDw6odqilkiolqlIThL+vVEJ 6vDd/fYSkZxDS2QIRvmNOuJ+pSZ9BXHbdH+y52dEoPMARnNAYmzVHyTlkSIzxZR+1k1n URC0ULJcCQEZAnLkE0JFLWyoj2kZd0Nc9iSN1rd/d4LagtCLNTabSM/ec7wGUEv4i/gh EQY9NYq34fx6lCLn+nZ9ofuoOWEjbJUaquzQ+BwEa+7kVw5u69Qd8K0KdHlr2keVOVB1 6oJA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i28-20020a2ea37c000000b0025e5ff8d79dsi255599ljn.517.2022.09.08.20.50.57; Thu, 08 Sep 2022 20:51:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230072AbiIIDcz (ORCPT + 99 others); Thu, 8 Sep 2022 23:32:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35944 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229891AbiIIDcu (ORCPT ); Thu, 8 Sep 2022 23:32:50 -0400 Received: from out30-43.freemail.mail.aliyun.com (out30-43.freemail.mail.aliyun.com [115.124.30.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C85BAE72F7; Thu, 8 Sep 2022 20:32:48 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R121e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046056;MF=jiapeng.chong@linux.alibaba.com;NM=1;PH=DS;RN=11;SR=0;TI=SMTPD_---0VP7oAkp_1662694361; Received: from localhost(mailfrom:jiapeng.chong@linux.alibaba.com fp:SMTPD_---0VP7oAkp_1662694361) by smtp.aliyun-inc.com; Fri, 09 Sep 2022 11:32:45 +0800 From: Jiapeng Chong To: jesse.brandeburg@intel.com Cc: anthony.l.nguyen@intel.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Jiapeng Chong , Abaci Robot Subject: [PATCH] iavf: Remove useless else if Date: Fri, 9 Sep 2022 11:32:40 +0800 Message-Id: <20220909033240.46329-1-jiapeng.chong@linux.alibaba.com> X-Mailer: git-send-email 2.20.1.7.g153144c MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY, USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The assignment of the else and else if branches is the same, so the else if here is redundant, so we remove it and add a comment to make the code here readable. ./drivers/net/ethernet/intel/iavf/iavf_main.c:2211:6-8: WARNING: possible condition with no effect (if == else). Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=2106 Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong --- drivers/net/ethernet/intel/iavf/iavf_main.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/net/ethernet/intel/iavf/iavf_main.c b/drivers/net/ethernet/intel/iavf/iavf_main.c index 1671e52b6ba2..e105ffeca074 100644 --- a/drivers/net/ethernet/intel/iavf/iavf_main.c +++ b/drivers/net/ethernet/intel/iavf/iavf_main.c @@ -2208,9 +2208,7 @@ iavf_set_vlan_offload_features(struct iavf_adapter *adapter, vlan_ethertype = ETH_P_8021Q; else if (prev_features & (NETIF_F_HW_VLAN_STAG_RX | NETIF_F_HW_VLAN_STAG_TX)) vlan_ethertype = ETH_P_8021AD; - else if (prev_features & (NETIF_F_HW_VLAN_CTAG_RX | NETIF_F_HW_VLAN_CTAG_TX)) - vlan_ethertype = ETH_P_8021Q; - else + else /* contains prev_features & (NETIF_F_HW_VLAN_CTAG_RX | NETIF_F_HW_VLAN_CTAG_TX) */ vlan_ethertype = ETH_P_8021Q; if (!(features & (NETIF_F_HW_VLAN_STAG_RX | NETIF_F_HW_VLAN_CTAG_RX))) -- 2.20.1.7.g153144c