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=-4.0 required=3.0 tests=BAYES_00,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS 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 D4C9BC48BD1 for ; Fri, 11 Jun 2021 12:32:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B5695613B8 for ; Fri, 11 Jun 2021 12:32:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231316AbhFKMeB (ORCPT ); Fri, 11 Jun 2021 08:34:01 -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-Google-Smtp-Source: ABdhPJwCOyXsVkHlt17OBdjoNwNbDTluawZ39cTrzWv1WE+/fKEDDZQ8/tqHpMPnuZmn/OlHD33hAFHJoVpjwQi6Xus= 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: netdev@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.