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 02BA2C48BE0 for ; Fri, 11 Jun 2021 12:08:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D2BA0613E9 for ; Fri, 11 Jun 2021 12:08:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231145AbhFKMKx (ORCPT ); Fri, 11 Jun 2021 08:10:53 -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-acpi@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! 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.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,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 C7B95C48BE0 for ; Fri, 11 Jun 2021 12:11:20 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 66DA861004 for ; Fri, 11 Jun 2021 12:11:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 66DA861004 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=armlinux.org.uk Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=uKEgh7rY/ghPRGVAm79sy/nRhY4+TivpBL5By+nZhaI=; b=w4pojqlG75EZRM 5zJPr3GunBs8FMS3aS7uzTdCVhdYYbSOJbd5nsJNPGGSYD2XjDGtcutQuvW3MUnz/+mmtGTeS/UKe e5gFsUECC3VnOFR1+oJ1Fbc2As0C/giE12Niq3wfCiwOYytd5b3dFdk9dslMU7soz3k5KAcRM4Gfj s4yfYundKuMHXWJ3diWyfvGA9xHc465tbmQXzVjSOT6plfDq6XxUdzb+IE6JkAoAfeOkPO7LEUoOY J7F9L0lfWxIHVirYaIo9wBwdx44V5331noYZ3wublbPm/P6a2zDlvPtoV824CoGANy/2uhNobHN4i Qlxfq+aw62KToG+xYTmQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lrfyG-005C5W-PL; Fri, 11 Jun 2021 12:09:08 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lrfyA-005C3v-1v for linux-arm-kernel@lists.infradead.org; Fri, 11 Jun 2021 12:09:03 +0000 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-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210611_050902_126691_B167A5E5 X-CRM114-Status: GOOD ( 18.71 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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! _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel