Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp5554791rwd; Wed, 24 May 2023 03:39:44 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5ab7THENhx+LRBrx2NWz2rgxgi9oFPqpExogdXenyoxecbr98D5fOJvabEHY7pz8qMlmo9 X-Received: by 2002:a05:6a20:3d17:b0:10e:3131:222b with SMTP id y23-20020a056a203d1700b0010e3131222bmr462173pzi.26.1684924783848; Wed, 24 May 2023 03:39:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684924783; cv=none; d=google.com; s=arc-20160816; b=uLiqRIf9cbz7DGlDeaMOanxb3ly1I6FcCQVUriiongKqKQdun13IIEa24zmqOmNKUA wb4/VCNzbBBJNpOz+kr2lu+5o1r185LSj3G9j2QJTxDXDGnXuuCkJaqo2FHlKayagkr9 wiJGKXIRPe66vDh6cb7+CPlWmDItYdgEiul5nXjjSP2qGSZ9JTDLo9v+vLBNiJ/sjld+ TXiEMDUbcB7CnS9Gs7AEWGb42ImGhlYes45UMSGKRES/3DkgJSW/zIGkxk1XnK8gWwJK rtFehWUj8zci0RiD984j/3zqfwHHTWxXmkH7Ia+o+xppHHyWocilnunI5DFv2CbSVcDB ZH5Q== 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=wj0Pki9hbv8VYhQo+pZA73I0iv1yUOy8GvHuMVBKwQ0=; b=tN9PGK7sPFXV0hvgDayKOvlaTGVAJ4QHp6ikEEtO6SEbfRPP/UqcGjO61dxcHwAiTC 83xnlqYgK9pptRp49ABQdsmY+3gn53a49pgDZbZIlewQ/lnEc4J9rYH/VsuLPSpeMQjC tR9LWY2BrLT/vUub5zm+HDDgvr5OasmD4g7Jm34qVYeL5rW0pxIt6wAMgWXpfU07SMRO z7XG1Qx1OjQzHbxNZv83Lcyiwy32TGVYUiTM8Z+H+TADDEy5a5cTOVuKEapU1pqBqcL0 z+puWdeEa6nNcwRN+uMhA2jqHXiKvS0Eg9iLK+GxJqnuxpjEyLV4uBUQzDJ3tcAMWQCl OkYw== 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 c30-20020a63725e000000b00524ecfa05d8si1239759pgn.15.2023.05.24.03.39.28; Wed, 24 May 2023 03:39:43 -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 S231259AbjEXKDZ (ORCPT + 99 others); Wed, 24 May 2023 06:03:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39292 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232718AbjEXKC0 (ORCPT ); Wed, 24 May 2023 06:02:26 -0400 Received: from out30-110.freemail.mail.aliyun.com (out30-110.freemail.mail.aliyun.com [115.124.30.110]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9632418C; Wed, 24 May 2023 03:02:14 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R161e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046050;MF=jiapeng.chong@linux.alibaba.com;NM=1;PH=DS;RN=11;SR=0;TI=SMTPD_---0VjNdztr_1684922526; Received: from localhost(mailfrom:jiapeng.chong@linux.alibaba.com fp:SMTPD_---0VjNdztr_1684922526) by smtp.aliyun-inc.com; Wed, 24 May 2023 18:02:11 +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 v2] iavf: Remove useless else if Date: Wed, 24 May 2023 18:02:03 +0800 Message-Id: <20230524100203.28645-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,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 if branches is the same, so the if else here is redundant, so we remove it. ./drivers/net/ethernet/intel/iavf/iavf_main.c:2203:6-8: WARNING: possible condition with no effect (if == else). Reported-by: Abaci Robot Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=5255 Signed-off-by: Jiapeng Chong --- Changes in v2: -Add a comment. drivers/net/ethernet/intel/iavf/iavf_main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/intel/iavf/iavf_main.c b/drivers/net/ethernet/intel/iavf/iavf_main.c index 2de4baff4c20..da5011359425 100644 --- a/drivers/net/ethernet/intel/iavf/iavf_main.c +++ b/drivers/net/ethernet/intel/iavf/iavf_main.c @@ -2200,9 +2200,9 @@ 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 /* The branch cover "else if (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