Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp2648813pxb; Mon, 18 Apr 2022 05:32:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyyxTB9C5BjWwwgoHevUMRdVgUlE833vk0aZ94hOM4SFWU0D3Cra2GlX0VvP9LgiXN+ZqdX X-Received: by 2002:a17:90b:1642:b0:1d2:ba18:3755 with SMTP id il2-20020a17090b164200b001d2ba183755mr1206069pjb.122.1650285159698; Mon, 18 Apr 2022 05:32:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650285159; cv=none; d=google.com; s=arc-20160816; b=f1GV2IO372K15z0c396XD/zR9rMIlQE13eS8OEURJyyDAVfAuIOpnBwBu+qpd6Ogmo wPONR2IFG4VVCDio4vwTo53opYe1S6QRH+689U2mCqu3wBcXzfDVjWV0s8/87red/51Z brMVXabVmweq0CGWL5Me/IAiGdbr9djjFR1pk1nLH7m/RuJxvTy5ApexIpBN+osotp3x VQNeFjqVpQUvHUWZuT5KIZFkbTFgWZzJ1cG9Mli9i2J23eSaUeEXUcE2Ajf6pp5eOOT8 6nkIe+1/XpJLcLzXdxpUo5jeNvGkC3A4jQYdBNQRS/X8BW+n/IuBPvs1I5BRQGG3r0EM zi3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=mHBrU/6FS1PWEDbIq/XDCf3uhBAcZz4F8hxO2TMTiLI=; b=vOJ6YxgM1SJlFpKzl3zhtWkN7pADyuNKjLteTMlsLB2OgEc6ow9Zwni7PRvDD4i1oa JvzYjnup+fHqg+s51Z8Q8WqnK1gV/097/DjMO2lrqKFrU7i21KRRkyVHN9Dn+EXtARIN cRgsLxhrV+Xdtqn0NluCQLmKdiUI3FS/n91u2/fbE0Erx8r60jXW4+3lpfc/aeXEBauR ZwvHGdpZI1VuhvEj/ome/TRkt+CYCQByoYUjbEFmiYlrTdbhy8kL3SYGOgUpeTDd/608 oAob+jRJpGpikQArZlVJYDVGHK6TdTmlHqDjmkaczxemjm2KzpiebDEU1Y/xdK06N2h4 cqPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Pbrr9ivX; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k71-20020a63844a000000b003a158337b8bsi8819810pgd.0.2022.04.18.05.32.25; Mon, 18 Apr 2022 05:32:39 -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=@gmail.com header.s=20210112 header.b=Pbrr9ivX; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232862AbiDPTku (ORCPT + 99 others); Sat, 16 Apr 2022 15:40:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55744 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230100AbiDPTkr (ORCPT ); Sat, 16 Apr 2022 15:40:47 -0400 Received: from mail-pj1-x1031.google.com (mail-pj1-x1031.google.com [IPv6:2607:f8b0:4864:20::1031]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BB5EA3056C; Sat, 16 Apr 2022 12:38:14 -0700 (PDT) Received: by mail-pj1-x1031.google.com with SMTP id o5so10107962pjr.0; Sat, 16 Apr 2022 12:38:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=mHBrU/6FS1PWEDbIq/XDCf3uhBAcZz4F8hxO2TMTiLI=; b=Pbrr9ivXtMgzgh6tAg+nn9bID05dXTfcaIe8ate3Wi8Ohs8t6EglfN2njyWlhjpTul tR1mINyTEbBvGPAhMgoSR1rQ4UPnlalDTu2iAw/L/tiSzzl7fdAIr6Ugqvo8ss6hD/dN UVJg69EABO+7PeFq4gKg21BZx3XELRHZSWcNQxJ/clehrKZCTOPln+2ntLmYORnGAqk+ 7z1X/i+gqjxIWPnenKvU7Hw4tOY/PXkSz0bb6LGJYDF+8QPHHUPQpAV8pBKDufq+9olJ hWtXkC0r0x0GPXCJ/l48JpaMEsFQoEwh0G4j/OD1VJdc562oeWatSqpIcm8HnRfH00Ot mY/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=mHBrU/6FS1PWEDbIq/XDCf3uhBAcZz4F8hxO2TMTiLI=; b=UZMjxG4z3xNP5uZAN/92L22L3pOFQPPipF/X1Mo2jP1g0eYtJPqjfiwju+zPFOBFFs xGxiUhvjsAiaGjyWM1cVNTqZDKuwh6nVVVOBGoOo6mXAyQKp3ubReXXYFQL6JXhZ6MgW VXnzmzAkzScZSagQpYaF3FZYEP8fZNZFWH0sNTpl3wK2oL3DJr8CnzEtZPp2wcP6hRTF kTsMIAOoYHeZKvWGnTLv+NbY4pzeldC9aN0EVKfDfJG7cQygJVFcQCY3FKI1/hddWNRg ynF2mNn8PC9sCqgOlC2zItiscEHywkW7SnCDnGBmOow66zaF3yPHWj/os+gVOseH2G/U SxNQ== X-Gm-Message-State: AOAM533QFRAXNBrxUYYksRMVdCTSABZGjXONFDPXSyOdav13TtrKJA+3 zKGy97YJbPIQtHwyOvyp1sI= X-Received: by 2002:a17:902:d511:b0:158:3be2:6637 with SMTP id b17-20020a170902d51100b001583be26637mr4462063plg.107.1650137894204; Sat, 16 Apr 2022 12:38:14 -0700 (PDT) Received: from [192.168.1.3] (ip72-194-116-95.oc.oc.cox.net. [72.194.116.95]) by smtp.gmail.com with ESMTPSA id q12-20020a056a00084c00b0050a4bae6531sm3749099pfk.165.2022.04.16.12.38.10 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 16 Apr 2022 12:38:13 -0700 (PDT) Message-ID: <20e56bff-b456-3301-0594-dac917416a92@gmail.com> Date: Sat, 16 Apr 2022 12:38:09 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 Subject: Re: [PATCH net-next v4 05/18] net: dsa: mv88e6xxx: remove redundant check in mv88e6xxx_port_vlan() Content-Language: en-US To: Jakob Koschel , "David S. Miller" Cc: Jakub Kicinski , Paolo Abeni , Andrew Lunn , Vivien Didelot , Vladimir Oltean , Lars Povlsen , Steen Hegelund , UNGLinuxDriver@microchip.com, Ariel Elior , Manish Chopra , Edward Cree , Martin Habets , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Jiri Pirko , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Casper Andersson , Bjarni Jonasson , Christophe JAILLET , Arnd Bergmann , Colin Ian King , Eric Dumazet , Xu Wang , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, bpf@vger.kernel.org, Mike Rapoport , Brian Johannesmeyer , Cristiano Giuffrida , "Bos, H.J." , Vladimir Oltean References: <20220415122947.2754662-1-jakobkoschel@gmail.com> <20220415122947.2754662-6-jakobkoschel@gmail.com> From: Florian Fainelli In-Reply-To: <20220415122947.2754662-6-jakobkoschel@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 4/15/2022 5:29 AM, Jakob Koschel wrote: > From: Vladimir Oltean > > We know that "dev > dst->last_switch" in the "else" block. > In other words, that "dev - dst->last_switch" is > 0. > > dsa_port_bridge_num_get(dp) can be 0, but the check > "if (bridge_num + dst->last_switch != dev) continue", rewritten as > "if (bridge_num != dev - dst->last_switch) continue", aka > "if (bridge_num != something which cannot be 0) continue", > makes it redundant to have the extra "if (!bridge_num) continue" logic, > since a bridge_num of zero would have been skipped anyway. > > Signed-off-by: Vladimir Oltean > Signed-off-by: Jakob Koschel Reviewed-by: Florian Fainelli -- Florian