Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp535865pxj; Fri, 11 Jun 2021 05:33:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwK02d19vgEhwNy2H938XzLVmAiNyCarxqEk0O9mIW2xLimVUTpgkitsqPRjY2GoWNUGKy8 X-Received: by 2002:a50:d64a:: with SMTP id c10mr3529320edj.199.1623414818251; Fri, 11 Jun 2021 05:33:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623414818; cv=none; d=google.com; s=arc-20160816; b=Qw9RG9YU2AxQxYVyVsO7/nTvbPOgvDuemiCfQLG751wcp+H4bPK0yTuXZ9mnTdvB8r oQYyAgyq5uBnhnf6XLzYd3Vyrm8r8vbxQP3rFnvXtblb6254Py8q+jEKJ2QAp0JQlURo ROlZkXwv8DZ+OE//Tc/4SgGlL3MvemvSmZFgAniCHCD7EHALsJQtHJ//mkChV0uL3cZi Lxbah99kulW5+g3Rw05cW5jpbLtTUadLSINz4Ev2wMsKSg6HEM0I8RYH7MeZ4HjrxrHH zAzQyhwMvrbMVH7aHrNMP64ahhykCc1/zPSSzV3LSJbQSMJrafdVMBjH4I7rmjTx4pzB 5JnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=Pa41k2a2Rwm0Si9XJrZMd28ASYH/qozjAczbkbkfJ5k=; b=cBvdzm6DR2iUko+NDJM1adsWNI1YV6pUCLd9zC5riQm87A6su7QWQQYeguvFKWpGd1 GZmtJnrs8NemcsKLTGzkNoQ8qxHoV3AyXVTKjpAaP3BHxAjHl5y//3YYdDawwm5Jn3u7 UDb6fKUU75T8gFnQxGt8hMFDryb8TOsJXtcNeQaLxPLfPeyWHABW3OGLR6UNUO06CDqt fbhZN3qA3+2auU2YhpTt5QDBq9i6+WHLWK22Z+YhEI/KNpd1xLYBiDGT0bdM8Y6jSjDc VIhGxP8IUCgHtpGImBeeL+KhYzW8+g70k/j0bXXJr6hCbL9BU62zf9n0eOPBRPc0wyYh l7KA== ARC-Authentication-Results: i=1; mx.google.com; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 8si4776933ejl.292.2021.06.11.05.33.13; Fri, 11 Jun 2021 05:33:38 -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; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231288AbhFKMeA (ORCPT + 99 others); Fri, 11 Jun 2021 08:34:00 -0400 Received: from mail-ot1-f42.google.com ([209.85.210.42]:39482 "EHLO mail-ot1-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230450AbhFKMd7 (ORCPT ); Fri, 11 Jun 2021 08:33:59 -0400 Received: by mail-ot1-f42.google.com with SMTP id 5-20020a9d01050000b02903c700c45721so2960109otu.6; Fri, 11 Jun 2021 05:31:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Pa41k2a2Rwm0Si9XJrZMd28ASYH/qozjAczbkbkfJ5k=; b=IZrqC/0qj2dbQK12JuaB8jyKBmxh3jQkB0xk8y/y1FPcJ9JPVXX6nLVmr41CW0ePMY YCAa/8zMoux9H78nRJy1qx7ytuyZ//0LL76ZvKGaHgBVvh1V+eQRYmtn9Im0cebRMwXu ikqJPUEFASUKeYEcGUu9KGfIUK1mK/P1t6pBAvx7Cr0xmqtn86dj2Vo8TCpI8xDnAqJa XnHKaMyz5tpE6NtAYfIbb5v3LqVOFVjJaEh+cmgwDbgjNV7svM7JnMyCDkGgic4cXNdG 7he3U68QU4uhVU3K4tVKQXMyZhy7jFkkAqGVpxZOubUVk+/xlGalwDQ8iew+6mew1eV7 44OQ== X-Gm-Message-State: AOAM530eWEhSTl5NRYik1bI2xGj9aKhTHyyVVBH4sSEl2J2CSd6eOW2d +vyUCwf1FOKNP0wuNdWIRM6MFr+LFFVVUU+t4zOIl2o4 X-Received: by 2002:a9d:3e53:: with SMTP id h19mr2947026otg.260.1623414709206; Fri, 11 Jun 2021 05:31:49 -0700 (PDT) MIME-Version: 1.0 References: <20210611105401.270673-1-ciorneiioana@gmail.com> <20210611105401.270673-4-ciorneiioana@gmail.com> <20210611120843.GK22278@shell.armlinux.org.uk> In-Reply-To: <20210611120843.GK22278@shell.armlinux.org.uk> From: "Rafael J. Wysocki" Date: Fri, 11 Jun 2021 14:31:38 +0200 Message-ID: Subject: Re: [PATCH net-next v9 03/15] net: phy: Introduce phy related fwnode functions To: "Russell King (Oracle)" Cc: "Rafael J. Wysocki" , 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 Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 11, 2021 at 2:08 PM Russell King (Oracle) wrote: > > 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. Fair enough.