Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp4076169pxb; Mon, 4 Oct 2021 16:55:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzMSSZH+ZE+LfTaEbx8B4p5znfyQRzANjQ+tXdk6xRBf4+QT22lQOOBMp81/le4X8C/LY3I X-Received: by 2002:a05:6402:49a:: with SMTP id k26mr22521892edv.279.1633391753040; Mon, 04 Oct 2021 16:55:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633391753; cv=none; d=google.com; s=arc-20160816; b=SzJ0L59DLCGFQxSipm8hH3HI8VGZtlVp0u2wduYMloRxlkxD+/ZvtJk1ez/cC5m1IE U9s/Bw7fJ0aoznSKb0lmM+m/gAfs6hUCRfSGc7gqySVJjRg5vnbu/WRsiAdrHpwjAjN6 7Gz1A7SfOj1CXuQqfLKTjpgg6SLe8fFP46LfFXeMgajMu/zXc1bO/CzznX+qWlIEpAc6 8DiqADignTqvFVS3iOwM8iQtifvwQQiGgYdx630/aWm1X3hpjR9d03WJkwENFoOSgTTZ qSBN1m3Xxa9OD0NwNX7IMxV6m0FVKsLra9BFfnUbhKYkJ1MBaiJWSmo/SAhtkjdv76/a 77kw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=Hzftuv3PjPqJSiP37NDPAWqu7Juih7yGqoA9fFvnUQk=; b=Ugi9nkdjd9vUMJrep1U3wgkPwvrqv+ErhfXk5VBqTjdcLKdDWr7RXZgZKDNTBvxAbL QMwFkSoJH1R0pDqlGRA8Bp+AGWeIhgo0Z773hhHYXFCAl5LwntSx2w+0s+bTnLgd4DNa gD0UcbCmb2X6SBrGIyqFgIkixIUh/1hOA+TMo5i1x1Yyy0rzBCPXMVOaKt2/SAQFQzQD sPKnUI9PvG71fwJ28nMOaLQokctJPnl92v+plW7wTvOM9YTZ2JeQxZBIYzT0VEaZdCor v7w2CGKFa0LlUxiphsxHRbnO6u0hB/lwcj5C+ELj4lSDfbh8KXZ6FNL83ETFSWM1N3gp Tvxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=sDgxro6a; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ga1si23187300ejc.128.2021.10.04.16.55.29; Mon, 04 Oct 2021 16:55:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=sDgxro6a; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233712AbhJDXGP (ORCPT + 99 others); Mon, 4 Oct 2021 19:06:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57768 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231575AbhJDXGO (ORCPT ); Mon, 4 Oct 2021 19:06:14 -0400 Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [IPv6:2001:4d48:ad52:32c8:5054:ff:fe00:142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C65C3C061745; Mon, 4 Oct 2021 16:04:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=Hzftuv3PjPqJSiP37NDPAWqu7Juih7yGqoA9fFvnUQk=; b=sDgxro6akYfeWFAiiSGMq4F79X nKsykoajwK4BAbwHVOzz9pLEYKMSK69CCNKfo14OUYuMcDdK7EDhfKI4YEqe3d0wgrFQKVo81A0JZ 8TEfuiBMC5ja/nmGK9FVRzgiw+UHtGL2C3c9gI61tmJoWjc0h39miLibrSZtxd2lps7FZVQBOULj2 XcYE4JPP64NPeqNa2uSMHRVcetuS94n2xVXXqcGRk+108Fky9vMpHBYeo8uH+qea8OBMMm7WPv/7C tsp6BWUCFFgOk5rSOTAp3LlUqhMT5n10rr9LokPo3+hKAejdwSblmpii6t1dOF3LHzoQLo4iFTkIA XX3zTyDQ==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:54934) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1mXX0P-00086a-Dm; Tue, 05 Oct 2021 00:04:21 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1mXX0M-0007ti-Hi; Tue, 05 Oct 2021 00:04:18 +0100 Date: Tue, 5 Oct 2021 00:04:18 +0100 From: "Russell King (Oracle)" To: Sean Anderson Cc: netdev@vger.kernel.org, "David S . Miller" , Jakub Kicinski , linux-kernel@vger.kernel.org, Andrew Lunn , Heiner Kallweit , Claudiu Beznea , Nicolas Ferre Subject: Re: [RFC net-next PATCH 08/16] net: macb: Clean up macb_validate Message-ID: References: <20211004191527.1610759-1-sean.anderson@seco.com> <20211004191527.1610759-9-sean.anderson@seco.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211004191527.1610759-9-sean.anderson@seco.com> Sender: Russell King (Oracle) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 04, 2021 at 03:15:19PM -0400, Sean Anderson wrote: > As the number of interfaces grows, the number of if statements grows > ever more unweildy. Clean everything up a bit by using a switch > statement. No functional change intended. This doesn't look right to me. > diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c > index e2730b3e1a57..18afa544b623 100644 > --- a/drivers/net/ethernet/cadence/macb_main.c > +++ b/drivers/net/ethernet/cadence/macb_main.c > @@ -510,32 +510,55 @@ static void macb_validate(struct phylink_config *config, > unsigned long *supported, > struct phylink_link_state *state) > { > + bool one = state->interface == PHY_INTERFACE_MODE_NA; Shouldn't this be != ? Since PHY_INTERFACE_MODE_NA is supposed to return all capabilities. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!