Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2376941rwd; Fri, 19 May 2023 05:06:42 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ43/cOR1zo560dAUxCLvaK/6y/1JHJSLtolP0jdrOzsvHfOWkmzLo/8vRUHUJXVt2CCmfT/ X-Received: by 2002:a05:6a00:1803:b0:643:6aed:3a9 with SMTP id y3-20020a056a00180300b006436aed03a9mr3090902pfa.0.1684498001356; Fri, 19 May 2023 05:06:41 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1684498001; cv=pass; d=google.com; s=arc-20160816; b=nZS+ugKDJRQJagx0CCYzd8XaYI/fE34cYxqROaCtCcIOFYUcX4XW6/qt69MLFKAbHp hAIGUQEvpW10Z9OLcZZCyWdWP3wMF6cY5eSSxrd+UHOzvSnpe56I5BCHbMcSSfGj/gRU 8VP33CGJvpVvpzWmswQeRp0Kc2i5QjVM93ph/ZiE9jxtl8CYzYRUYB3Sj/K/b+1lDyYs LRQQ1rR2CDAPzBnMDWAhPD2+Z5sBQc1bdIldR0f8Ty6nOhGqk8q4ysuVJAXLfo0PyT/j cYJHmgCAaZpJpJdyQjo6SFcmMN5cYmac8WlvikIbHvS+rxR8dvuVj43qc5pDRutd/pyH Ywng== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:in-reply-to:content-disposition :references:message-id:subject:cc:to:from:date:dkim-signature; bh=1AnwNhjhT3L4hDTyQFxthuy8CtAWIL9izByyW9PTY/o=; b=QdxrDDHi9vWRwytf6xm1+z0bCyeLT6GuZEEw1BfNx46GKSH51BSUWIIyN2qV7yzRK9 R2EzwLkwPQV0AQQKP7E2RHla3THNPyFPT0AObSoSbcjkO0GTDQ6RBuV2q7MxBp1lSc7Q Mfc1tJPuxyqy5tj7+6HKK6dzuFOtlDxdTUYRyBgA1nchpgBhZTqQFnIBO4E6D3Ww2lg5 GrM7iR7emQjzYEKBsWf8zaIPEQQi1xB5DTUu/IL+KUbA3D822TwfrKpAtUYczkoQbjjf 96pZfqwHf2UeWQ7MvXGwTcYUlY4vION1nGuPmrX0OiihCGzVTnsgrjoAZi7Wqsocz/Zj g+BA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@corigine.onmicrosoft.com header.s=selector2-corigine-onmicrosoft-com header.b=XbUZocQ5; arc=pass (i=1 spf=pass spfdomain=corigine.com dkim=pass dkdomain=corigine.com dmarc=pass fromdomain=corigine.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=corigine.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x15-20020aa7940f000000b0064105588e53si3781008pfo.359.2023.05.19.05.06.28; Fri, 19 May 2023 05:06:41 -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; dkim=pass header.i=@corigine.onmicrosoft.com header.s=selector2-corigine-onmicrosoft-com header.b=XbUZocQ5; arc=pass (i=1 spf=pass spfdomain=corigine.com dkim=pass dkdomain=corigine.com dmarc=pass fromdomain=corigine.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=corigine.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230464AbjESLyu (ORCPT + 99 others); Fri, 19 May 2023 07:54:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41058 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230198AbjESLyt (ORCPT ); Fri, 19 May 2023 07:54:49 -0400 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2101.outbound.protection.outlook.com [40.107.220.101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 13C3418C; Fri, 19 May 2023 04:54:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Qq9FfEPnuaCQPVgdNH1dWrkcDFTw42EDOwvMoIa2zHIW2hl/YOhGIHQHWeKvxhy1YB5oS35SrqNe+EW1HWmL/qD3VlADXWGAR3duELxtgpf9cjepZYSuVHPXnQRMIy9720EmS6Sr18FuBX1EScSreiAenqayg10cCX76lldG+naE3EVIXdmMfbyDeOGE60fogLtISgCPTTPapFrZWZouTF8VCCJY0A5k4O65RRDhe1RPFSVMn2/C2pC/TJ2WPcB5g/nzcVQf1hxv0BZcMcM9KVxsShFmtlazRywS5ccQJDoE5qBEykq+LkFCIG4qMAXPwPJRBvOjLWL3UK1SqQCHlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=1AnwNhjhT3L4hDTyQFxthuy8CtAWIL9izByyW9PTY/o=; b=E3sKWra4o4Okkvr9D10iaUt9As8AGg1H1uinmoPnR8C4PRCcpi9E/qgbOk2W/IDqDljGYcrVCSPClwkSj7vkwIbx4hJ77GEx4JbRbw1S4YU2egjN9tGkgyG1d3IqdAwZ80LDMDC0e1M4mhbDCXuWoVbGAwgUBm6welwRyIl9lo8fuCJxYpnJbY5OPlW/WB9q52fqCGF2FDAO2MOjXGpRtHzAtc/ii1ckvhoDEBqA7gjz+AgRGJiZlgksLbeOYlxtY6pGuXYi7q2pLQhUfy+L+TqouW5tx3JekYaczLfPQ2B2jEcxQvdy5kWV1CKSJlqMUqyd0GJNGLLi+hROZbZ6NQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=corigine.com; dmarc=pass action=none header.from=corigine.com; dkim=pass header.d=corigine.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=corigine.onmicrosoft.com; s=selector2-corigine-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=1AnwNhjhT3L4hDTyQFxthuy8CtAWIL9izByyW9PTY/o=; b=XbUZocQ5mMLzvbeVAx7XgzbWXr09SPjMIO8sBWmoOy7G7MG/usgtUry1yahQ2DbkSIn5Wu4nsAFFewtldK5bO8Wm391HWwQuguTNssV/iA+pqM5X9bqsVD71S5Lav2bM/ZRAY29js1NZkwClZeZcePAAWkgVkpBPvfzisawFpdk= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=corigine.com; Received: from PH0PR13MB4842.namprd13.prod.outlook.com (2603:10b6:510:78::6) by SJ0PR13MB5285.namprd13.prod.outlook.com (2603:10b6:a03:3d5::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.21; Fri, 19 May 2023 11:54:43 +0000 Received: from PH0PR13MB4842.namprd13.prod.outlook.com ([fe80::f416:544d:18b7:bb34]) by PH0PR13MB4842.namprd13.prod.outlook.com ([fe80::f416:544d:18b7:bb34%5]) with mapi id 15.20.6411.021; Fri, 19 May 2023 11:54:43 +0000 Date: Fri, 19 May 2023 13:54:38 +0200 From: Simon Horman To: Jiapeng Chong Cc: jesse.brandeburg@intel.com, 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, Abaci Robot Subject: Re: [PATCH] iavf: Remove useless else if Message-ID: References: <20230519083848.58828-1-jiapeng.chong@linux.alibaba.com> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230519083848.58828-1-jiapeng.chong@linux.alibaba.com> X-ClientProxiedBy: AS4P195CA0007.EURP195.PROD.OUTLOOK.COM (2603:10a6:20b:5e2::7) To PH0PR13MB4842.namprd13.prod.outlook.com (2603:10b6:510:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR13MB4842:EE_|SJ0PR13MB5285:EE_ X-MS-Office365-Filtering-Correlation-Id: 7bfbee25-2b2a-4b08-09e6-08db585fd5c1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: qt4Q+wvOQIGinDUN3tBnKAz14TMm7NNlVi9h2AS3cJNrXZXlmLj1wed79M4z7dbTlkj0P522j9tB4r7RqptKH2WTHIWNqQAQ3JKefmT31AuY1FAGLi+KYyT8UfQi2WKH4vlV1FKRdG8FvUOuO6dA4w96ydLRc4FTtmMEuS0ek+teCzz3E2KLKdc+Odr9otSieYZBOd+FOdTKKkkpz2PTBozLgj9xNKdZ3iocx+nj2igO9ZxMc517rdpM9p2oy3PS5DLujpmtcOj5hlzP8kY6LSHVr+tEnyWbM8vgdaVxorogY3VllVGK400drc0boN6apm6BU9j9FlrB6o9ZTU7IDkHNmE96atj8jl356ZqPck0jBQMTPyxSvAHuU0yqgSUoOevIIRXhL71V5CtBiDGPJFEJqrB+HOQfzLh53U492N9+GRmxCMlE1PJMeQWIQV7fCEGKtDl8zQZIYKzXHqGwdWmhzejf6THwu5vH7ExzwKrkpJ35f00vNM5iJpZAPgEvVMSVOCsY2TV5Is2JBW6lrjgASWIXJnKg2HYIyy4/zYaHPsDQ+gr/E0ayCyQz/Qa7WyUihh80wYsw+87Udo5IVErUEqUCIdGXuReONNCprLQ= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR13MB4842.namprd13.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(136003)(39840400004)(346002)(376002)(366004)(396003)(451199021)(966005)(6486002)(6666004)(478600001)(83380400001)(2616005)(6512007)(6506007)(186003)(2906002)(5660300002)(44832011)(8936002)(8676002)(7416002)(36756003)(6916009)(4326008)(38100700002)(66476007)(316002)(66556008)(66946007)(86362001)(41300700001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?/S5fWu/iwnlwVsTFmx4GEPXOebGsB012diTMOOMj/clZXx4aIHFc8Ind1cbg?= =?us-ascii?Q?BA6eNWVTBV//PnPnmUBloOfRH+nymkjtuaLrwmE9iFk2Bx/2BWcImhqgc17W?= =?us-ascii?Q?fVVjWacSujlf4p2G+xk++anN1tfFdqv+ydUGla5C61NvLyd6NnMRwgZORggd?= =?us-ascii?Q?NmqWUOwADpUeA7rUi5j08RvCCWNBytDK9uqeQoRET0N3r99fhGM9y1BN/C70?= =?us-ascii?Q?4DEsuRFebcxDfd6x0PQVy7pBXGr4vdzhsm3lTlHx3buOl4C6dysyT67Piahd?= =?us-ascii?Q?yPDdzOq7X9FBx+zPyqo1lIeBNcJQSdZ0+sIF3KpE79DCuRv5b/8gBsU3Ce1P?= =?us-ascii?Q?4xLWFocsKtXOrRJAN+FX+A1Z2tSHGE9dga08I+9idGqdvZR++7obJ8a6rdHM?= =?us-ascii?Q?MEZoReeilVTtlJHWi9m4YmroLvFP3Zr9x92NGtnSfAvFxr6EXGu4NEDs7Kai?= =?us-ascii?Q?C4dS/LCv5gC6ak1L/M+URzPiRYQjCKtBSENslo710t1qF5BoCthXPruF2sIb?= =?us-ascii?Q?PKhEgyBnVNxF2uszYgsrZxJQFN+oFPJNKGBHppOjp1SL5CqE0/e7PFAYFc1B?= =?us-ascii?Q?3lkSkEJKQMCzBR5qUor97zbPMXR8mq6mxbDO5Tmr26mpocs4v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Vc/MzPo4E2J+BfpWx1qj3x8Hz9VCu18DhkGu8EzCH?= =?us-ascii?Q?h5Un8kRgGtahgnv+LYs7d0W8hFFCKxdjR7UC7JJhxXm22Lgnj9rFS5Rl6Lbu?= =?us-ascii?Q?hxUSzPPh8T74rXR3IvZ07nVHwRbRUWA1SaT5/L+Hsaab0yGO+ZT9v59urRGZ?= =?us-ascii?Q?8YQeGA=3D=3D?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7bfbee25-2b2a-4b08-09e6-08db585fd5c1 X-MS-Exchange-CrossTenant-AuthSource: PH0PR13MB4842.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 May 2023 11:54:43.5559 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: fe128f2c-073b-4c20-818e-7246a585940c X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: bOkr+t4A6Dg+tdZ1YN8XjzKCLGXrnH5YR1YtqxD2FYlDzkGsFUsiMbH5IoICzGbfLxy0P7IRnhqGbqv+t8ZYtr8REl4rq//TT/rCGSQBUBs= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR13MB5285 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 On Fri, May 19, 2023 at 04:38:48PM +0800, Jiapeng Chong wrote: > 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 > Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=5255 > Signed-off-by: Jiapeng Chong nit: This should be targeted at net-next. Subject: [PATCH net-next] ... > --- > drivers/net/ethernet/intel/iavf/iavf_main.c | 2 -- > 1 file changed, 2 deletions(-) > > diff --git a/drivers/net/ethernet/intel/iavf/iavf_main.c b/drivers/net/ethernet/intel/iavf/iavf_main.c > index 2de4baff4c20..cf8538cebfe0 100644 > --- a/drivers/net/ethernet/intel/iavf/iavf_main.c > +++ b/drivers/net/ethernet/intel/iavf/iavf_main.c > @@ -2200,8 +2200,6 @@ 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; I agree that the assignment is the same. But the current arrangement does very obviously handle NETIF_F_HW_VLAN_CTAG_TX, whereas in the new arrangement it's unclear if it is handled or forgotten. Perhaps a comment is warranted here? Something like this? > else /* This covers both the default and the * (NETIF_F_HW_VLAN_CTAG_RX | NETIF_F_HW_VLAN_CTAG_TX case. */ > vlan_ethertype = ETH_P_8021Q; > > -- > 2.20.1.7.g153144c > >