From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.1 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E1408C48BD1 for ; Fri, 11 Jun 2021 12:09:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C4AE4613E9 for ; Fri, 11 Jun 2021 12:09:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231548AbhFKMK5 (ORCPT ); Fri, 11 Jun 2021 08:10:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51538 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230280AbhFKMKw (ORCPT ); Fri, 11 Jun 2021 08:10:52 -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 ED732C0617AF; Fri, 11 Jun 2021 05:08:53 -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=9b4NjnnY/G+BJnLJRscB32ZmK4BCv0m+aCZcDteGGuY=; b=hdDWo62YgSsybD3rJr5oMM8qr JHg6yt2vu8qYDh6QsYM8qg1UdFZ82JGrg1qeTvb5FqYr6bhmytcH6w6NAS40gQwyBnFB0mLVkiSrU uaiDNqMCWDxdAx6Mh2TgJhPTUPurNWGwA5oyyxWNuKknhL+FyAprE1sYmmnEOky3Yo/4W1IRX+Mqf hgfdJA3YIhxHlof/NIf9NNnj7KhVOFnBPY8zv2pXTMYmjzMT2yhlAierEgsLqr5NpNCotdMcQvSrU vSAzBBABgeY5xapVjSDgU7clz8e0s88ZBFQigyA0OWVhJVebGFHaMlAbnE+gUnA5Z4/LwVHD5EX09 2uFVa4suA==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:44918) by pandora.armlinux.org.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lrfxv-0001AA-2y; Fri, 11 Jun 2021 13:08:47 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.92) (envelope-from ) id 1lrfxr-0001Hc-Ox; Fri, 11 Jun 2021 13:08:43 +0100 Date: Fri, 11 Jun 2021 13:08:43 +0100 From: "Russell King (Oracle)" To: "Rafael J. Wysocki" Cc: Andy Shevchenko , Ioana Ciornei , "David S. Miller" , Jakub Kicinski , Heiner Kallweit , netdev , Grant Likely , Jeremy Linton , Andrew Lunn , Florian Fainelli , Heikki Krogerus , Marcin Wojtas , Pieter Jansen Van Vuuren , Jon , Saravana Kannan , Randy Dunlap , Calvin Johnson , Cristi Sovaiala , Florin Laurentiu Chiculita , Madalin Bucur , linux-arm Mailing List , Diana Madalina Craciun , ACPI Devel Maling List , Linux Kernel Mailing List , "linux.cj" , Laurentiu Tudor , Len Brown , "Rafael J . Wysocki" , Ioana Ciornei Subject: Re: [PATCH net-next v9 03/15] net: phy: Introduce phy related fwnode functions Message-ID: <20210611120843.GK22278@shell.armlinux.org.uk> References: <20210611105401.270673-1-ciorneiioana@gmail.com> <20210611105401.270673-4-ciorneiioana@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: Russell King (Oracle) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 11, 2021 at 01:40:59PM +0200, Rafael J. Wysocki wrote: > I'm not sure why you want the above to be two if () statements instead of one? > > I would change the ordering anyway, that is > > if (!IS_ERR(phy_node) || is_acpi_node(fwnode)) > return phy_node; > > And I think that the is_acpi_node() check is there to return the error > code right away so as to avoid returning a "not found" error later. > > But I'm not sure if this is really necessary. Namely, if nothing > depends on the specific error code returned by this function, it would > be somewhat cleaner to let the code below run if phy_node is an error > pointer in the ACPI case, because in that case the code below will > produce an error pointer anyway. However, that opens the door to someone shipping "working" ACPI with one of these names that we've taken the decision not to support on ACPI firmware. Surely, it's much better that we don't accept the legacy names so we don't allow such configurations to work. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!