Received: by 2002:a19:f614:0:0:0:0:0 with SMTP id x20csp29907lfe; Fri, 15 Apr 2022 17:57:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyJQabSuMlv+AYnVCYeZFtGc9JIl3h2wBHj0GFb9z9dmDm4OfZAfU+34/1An1tdU30oFpC6 X-Received: by 2002:a17:902:dac5:b0:158:5db6:3503 with SMTP id q5-20020a170902dac500b001585db63503mr1530157plx.76.1650070665554; Fri, 15 Apr 2022 17:57:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650070665; cv=none; d=google.com; s=arc-20160816; b=0wwN2e3mcnvCPLAjbLTqQeVL5NpGpt/VyFnpX21AsceTr8QX5qrAu0vtBBBpNQaMKE HhKVjJtpVQcqD9zlIbSPt6B08YrH0rrDILo9LoepaZBcNaPhoXEkkhUSjntgbpctiJLd Jc6fdCkYY5tpHVt2WZO9xzq1b/H0F9/vp2dJOxCU7FmEz4/Hg+kF1XOlPfFGjrMvij+G JmujhmnMsolflR2iArptVjT9iD/9pWxWrm+wght7PdSr0l0w2rGf7CQ83n3ZK2rSNrlo p+IUXJ+td84JBE82b99vMYBYjx1MEWZVBC1H5ENYBgx14vcudRR5DVwCxD1GmvU/TK/P WS6g== 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=3KCYsQY/y5IS+uLLSbczPyROpjTi5JnKwjdboy6JQyM=; b=L8cjfWMiBeLzlhqw/wSj0E/eCSbAZdpzaWmvIkdQVgVUA0D6HAHZeF0wxJWLnCMGMV Y1Uue4tWAc+sTWCcxfH2LX+AhMFZj9h4oFGiqwIhPKHS+F4XQ2uwZQgqsXxFSodO0aa5 rbXbCEzrvaUsA8MHojuthz9MhtkXCbPbfvJhksHNW9MyAtem3Wsn7e2AGUQuSzb8RYmq ipM76WfvAX7odShxla5OGhsFuRKO35Y/yEv74jABbwE39uca5wsWnrzI4JFsTwxaLvQH SH8oeAh8YCNl6Coq1qwMfopoWCNZGMPuZgkwXlharRR7qnuMBw4JWQm4hGYkXqqlbA7Q DnKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=c8tJ2FSS; 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 q2-20020a656a82000000b003816043eea4si2883836pgu.153.2022.04.15.17.57.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Apr 2022 17:57:45 -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=c8tJ2FSS; 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 8C8513EBB1; Fri, 15 Apr 2022 17:43:30 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353480AbiDOMdn (ORCPT + 99 others); Fri, 15 Apr 2022 08:33:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59996 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353824AbiDOMdW (ORCPT ); Fri, 15 Apr 2022 08:33:22 -0400 Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com [IPv6:2a00:1450:4864:20::533]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BEF102F03F; Fri, 15 Apr 2022 05:30:53 -0700 (PDT) Received: by mail-ed1-x533.google.com with SMTP id 11so4757131edw.0; Fri, 15 Apr 2022 05:30:53 -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=3KCYsQY/y5IS+uLLSbczPyROpjTi5JnKwjdboy6JQyM=; b=c8tJ2FSSPaEqVRtRhXYc8sgQTfYtNFcB6CTG3Ae0iCHlMVPDi0c3SICkTbZwepYo4p xU3X93yaYi8aAlcXrdADKu2LXuxPn/GR7oL66fnPlgJa7OmOINJ/xEIQL+6hYZ8yUSoQ 7Xak+mMuwkZw1URcphJpYDVHc7+nXeWht2xleoSi85Cdjpf7ai9zz6uYmZNGppEYkvFL aEG6B9HNWYFeXTxuwGQSdH8x7YqoiGZ719kpFy5Idm1Rx1wMNcnUOLyT/LzIulvfprEo plYsODJ40dQzFvq11UTfXkDNAIZmPJ/Zxw9fHFQsIuJIA/bdMy2HR30antzmBYlQTAng xF+g== 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=3KCYsQY/y5IS+uLLSbczPyROpjTi5JnKwjdboy6JQyM=; b=VJD+KLJSEFC0r13kFaEQwNk7tXUO1YiLKqUuAtdBMzV2t7E23EOWjUCJ909fVawzUf M28qv/ipqPh8d2d720OkTDzsYwJGDzEroMooBSbyzlnJE/8mgQfEXrvRIB5va5t//EOA 3oIyJFWsqDXMWVr+SJGqFAs74yMjMcuRBi7j12ylslko1D3TWPdp+K3syXh2gm4P9k+h 2Wbmbj1dO6A/DAQsT/lMRP+x3wRJo81gBTNK0N5gbIZj5332i6roFjxcCOqUCEI+fDmG soOAsc57nqnqQbgFnuUxNI3B8275VrolzLdQdvVQANUekJQ6m30HbvO7Zym6uzmnUzZh v7Aw== X-Gm-Message-State: AOAM530EjQxoZmnWzhz/3Nww2nzJ5KGZs0tWH6Q1yRpaBtysTttu2ewW Um+KGDu+Vu1t8v+IzuAWfvo= X-Received: by 2002:a50:d592:0:b0:41d:6bae:bd36 with SMTP id v18-20020a50d592000000b0041d6baebd36mr7951369edi.221.1650025852122; Fri, 15 Apr 2022 05:30:52 -0700 (PDT) Received: from localhost.localdomain (i130160.upc-i.chello.nl. [62.195.130.160]) by smtp.googlemail.com with ESMTPSA id bo14-20020a170906d04e00b006ce98d9c3e3sm1649533ejb.194.2022.04.15.05.30.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Apr 2022 05:30:51 -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 , Bjarni Jonasson , Jakob Koschel , 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 Subject: [PATCH net-next v4 05/18] net: dsa: mv88e6xxx: remove redundant check in mv88e6xxx_port_vlan() Date: Fri, 15 Apr 2022 14:29:34 +0200 Message-Id: <20220415122947.2754662-6-jakobkoschel@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220415122947.2754662-1-jakobkoschel@gmail.com> References: <20220415122947.2754662-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 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 --- 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