Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp520527pxj; Fri, 11 Jun 2021 05:10:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy0PZpUy23n0JGL6c7K3zCEjAjhaDo17PJ5FDfBHLafHOzi/p2yFN3cd1vul6k2l8aFuDke X-Received: by 2002:a50:fd13:: with SMTP id i19mr3318811eds.280.1623413450777; Fri, 11 Jun 2021 05:10:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623413450; cv=none; d=google.com; s=arc-20160816; b=Dv2CkqvzPEvjlbYwOq6JTrIddiHr8t+6hHiIJqtJLy/GAVmI3EH2OZsbmUeyZwcp4X KBAsalt2lHWYqaLSIHAOg0rc6R/hmjl9OlxjYyLuRE5gEmI3we64ecqdP3eGXiZQqrQp yBW7wRBr9NmTtXNVlwDkB0fBP6D5//47ZB1VtGY3FRnfFuTuzXTGvLQykiiLSAp1+MuD XRXRfFfG9WbhZSfbU2Xua+EH39KiYKX3JZmy/88rq3XW225EpJdF8WlQVEkyXmHFESHl MLpNH+ZP8vGqGz7CxXn+pLxSh78UIsiFR9tPHG2CzaclVPsbQaH816NNtlhRZ3nOxDeO 3UPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=9b4NjnnY/G+BJnLJRscB32ZmK4BCv0m+aCZcDteGGuY=; b=Umrr4TS41WJyQlc6nA1A2TvGY+aqKIWm7qFtHRLii7XJXQnOLey/1A9c2thdNMb4iP T/fbmb/v5y1hHbM/J0UlRG++hIqGpkiQNrbrLXpAe5MiNGhzqu2HCRqyYcI+zWvZvtde dpbdCw7Cqzv50s6IW8vCA4+us+CsHYtjjWnCr2KRBIDQrCudpxKMgkSJW1hygFldSMBr ngjyIwkQXVaatm6W79Jz7g2Kt77vGLHcqCCv1yw3a7a4VvGNXZwoHpQrcn0WdNFfkT6z bcmIcHT07v80bI8fPUAi3xtAAosoYa+kJv42KXxdStXtHl9JYIdIXrBk5FsDfgCcAJ/2 oXBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=hdDWo62Y; 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 t14si4582982edq.26.2021.06.11.05.10.26; Fri, 11 Jun 2021 05:10:50 -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=hdDWo62Y; 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 S231510AbhFKMKz (ORCPT + 99 others); Fri, 11 Jun 2021 08:10:55 -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!