Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp824044pxb; Tue, 12 Apr 2022 14:29:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzMufsQsPunhGwFuyf5LLx52EBi10rWpc8yYB33lHl7Mflzrk4aHEoo5BDE7pERS2Isfa1Y X-Received: by 2002:a63:7d02:0:b0:398:9594:63f4 with SMTP id y2-20020a637d02000000b00398959463f4mr31658807pgc.375.1649798942497; Tue, 12 Apr 2022 14:29:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649798942; cv=none; d=google.com; s=arc-20160816; b=St0ILiJGa8qNe08tu43sYfhzPHWQ4Q+fLSa7AaASzZxffrjd0gd/Jlhv4+JCruh/am G1YwMdtDTXPLaGj9EjyU6jC2TgVC58t0IMZt0w+Na4dYc4cR/RdNx5O0d+ee94/mp3oX wlo8gvChNmoE1glngaMeARp2K0HMsf+IGmtTCNYoLqmbF4R5hw8LpVI8vzk3unEtvoum SCm5EfNSYrkw6R2BPRPthe7XK6++IEwDdA625xkPIblNd9QHLRpxQ5EzvR7A8T7S1LA1 i9XAKt8EcAx9n8bx/Gdqr+qoT4ejkbuVpIc3LNj3iZPZog3GbMD/DiwfWy+O8gHErO0g 5D2Q== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=PwlvdFh40zWrnBHSnvRolkyWcqqdHXS406E/ZGgN6EM=; b=ktEDm/en20oc8DPun2t99NuomHpQCat1jK0o19qtyKA9MqMhMM5BLJ5uKhRqjyLzmT vzbSF2D8PCXXJrzbUq92l1sVTFRkQKaTxlDhAX8tuxChFUbFGyB72BKg8j4vsdec2g0Q l/J7Y9qZ5Buy6HK7+ZaBjPvhvmUu/YfuyJ5Hs7GGYSFFQg/tdl2rIGrhAM2Rc54jsy65 w/rqXURKyDPRf/3EOd0ZxsfK9s/vdYqfq8bPJpqckvCvHPL+yUn5IXN89rIxxdp76SqI E22iW3Lbxpwrj8U4wlkZtP7ErMFfTrlqwAc4AKYXwRobeUn5v1U0g+D1yFz9V0mhRIyb yDjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=qbvgYgag; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id v125-20020a622f83000000b004fa3a8e0095si11757623pfv.332.2022.04.12.14.29.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Apr 2022 14:29:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=qbvgYgag; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 3469F1179BF; Tue, 12 Apr 2022 13:40:39 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347826AbiDLMF0 (ORCPT + 99 others); Tue, 12 Apr 2022 08:05:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39866 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351382AbiDLMCh (ORCPT ); Tue, 12 Apr 2022 08:02:37 -0400 Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com [IPv6:2a00:1450:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BBC0878062; Tue, 12 Apr 2022 03:58:59 -0700 (PDT) Received: by mail-ej1-x62f.google.com with SMTP id u15so17893593ejf.11; Tue, 12 Apr 2022 03:58:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=PwlvdFh40zWrnBHSnvRolkyWcqqdHXS406E/ZGgN6EM=; b=qbvgYgagzSXxv6YmhWQbxqNdOmSbQgfVFVfg080pnmD2QQT4ewAjsptb6A151wy3qB l6YN8srio8jNhYnocQB9/Du9NaXc7tZUtoTURut7ItC2ERogITRXDModlgdtZqjY2hoA vYjbslfGvCzth9QlMXFSRC8+gpbvhVtL9EnROoIzIai1bv0v+3U8etOIs85gXb2avuu0 wXup3n/MaYi0FQUmW7W9MseeBhsedGuwcgBndyFWy1KvjzSHRp3PnwiU33VAYbjVdr+k XXZ7rWh6GJt6kkgM93uVduBBw0Piopt0wRQtEsiohjxYPFVFZXdutCjO5dD/WJCTgmfj RZdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=PwlvdFh40zWrnBHSnvRolkyWcqqdHXS406E/ZGgN6EM=; b=eXih0CSBXAC41lKBORjVqYfvD/7vSt0q9b0TVgKByaPdsCMlVt8478ELjS16uHmX+7 xlhycBZncNyBKQqx6vWirlkaUkR0AtHxFT2GWRC3XJsUs0NwDa1ACVfqhaZdlUF4/Cz0 LU/d21Lb0xz8tCiXfPkzk6eiFn/CQbwvaBVCZ/n+KeqZo7rsajGEGniUYuM2oVqH1DH+ p4aOC/zP8G9scXMshMoOQfJARCquLrK6pxG8ELKV8cNek2wJ5qPruYJ7Osc2a0+EO7wS 904ugEPLvdMtAOYLcKEbMnxYZa/CiUQIXk2GDitYIRYEs9FirNXIQp4sqXXQklXdrteY +/WQ== X-Gm-Message-State: AOAM532khrwTbBNj2M2XdcUDuMUvdIBsToCBFcB7n/h1kKMnc7zBZauQ A3u//cJ0Hw9Sl9/p2hZ/Uio= X-Received: by 2002:a17:906:c111:b0:6db:cf0e:3146 with SMTP id do17-20020a170906c11100b006dbcf0e3146mr34735453ejc.280.1649761138218; Tue, 12 Apr 2022 03:58:58 -0700 (PDT) Received: from localhost.localdomain (i130160.upc-i.chello.nl. [62.195.130.160]) by smtp.googlemail.com with ESMTPSA id f1-20020a056402194100b00416b174987asm16986370edz.35.2022.04.12.03.58.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Apr 2022 03:58:57 -0700 (PDT) From: Jakob Koschel To: "David S. Miller" Cc: Jakub Kicinski , Paolo Abeni , Andrew Lunn , Vivien Didelot , Florian Fainelli , 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 , Jakob Koschel , Colin Ian King , Arnd Bergmann , Michael Walle , Christophe JAILLET , 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 Subject: [PATCH net-next v2 05/18] net: dsa: mv88e6xxx: remove redundant check in mv88e6xxx_port_vlan() Date: Tue, 12 Apr 2022 12:58:17 +0200 Message-Id: <20220412105830.3495846-6-jakobkoschel@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220412105830.3495846-1-jakobkoschel@gmail.com> References: <20220412105830.3495846-1-jakobkoschel@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 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: Jakob Koschel Signed-off-by: Vladimir Oltean --- drivers/net/dsa/mv88e6xxx/chip.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c index 64f4fdd02902..b3aa0e5bc842 100644 --- a/drivers/net/dsa/mv88e6xxx/chip.c +++ b/drivers/net/dsa/mv88e6xxx/chip.c @@ -1404,9 +1404,6 @@ static u16 mv88e6xxx_port_vlan(struct mv88e6xxx_chip *chip, int dev, int port) list_for_each_entry(dp, &dst->ports, list) { unsigned int bridge_num = dsa_port_bridge_num_get(dp); - if (!bridge_num) - continue; - if (bridge_num + dst->last_switch != dev) continue; -- 2.25.1