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 63116C48BE0 for ; Fri, 11 Jun 2021 12:32:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 40564613B8 for ; Fri, 11 Jun 2021 12:32:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231178AbhFKMeA (ORCPT ); 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-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: linux-acpi@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. 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.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,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 B230FC48BE0 for ; Fri, 11 Jun 2021 12:33:44 +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 6EA26613B8 for ; Fri, 11 Jun 2021 12:33:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6EA26613B8 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org 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:Cc:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=FdFh7Wd+3r6YPMOguHlEfAcILIWkdIZevNhm5Xso/Eo=; b=ytB8gxr7gTcwUk 6/VH5/gBLq3e3f5EjZnX18RW8n8+FakaEQYFGAXFBAQ1CQa8SjAX59j4v5OpJVQm/+++uebmTIENN u5U4ZXYQ3IIRvDrQczjgpBc5o+FpaJRuZn4X4SzcsmFnUZzcUiQMQ+FmHNZHPwlNUuD+4LEiLcb+T mHJ1ibgbMY2HzoGGnNi1RJSJL1Djrq7hueUvhB56ykkgMZxqvErUEidDPiPn2fZ5nnnfF1rqEckAR 0QfDUTDOfM7PY2/JeJ0RTlIcPPtAeD4lwplbGBisGMpDRY1AQ/NFYp8WToKf6nn5pxFdtViQO2uJP GCNzwtvG+88ISisjDEYQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lrgKI-005Fd8-2j; Fri, 11 Jun 2021 12:31:54 +0000 Received: from mail-ot1-f49.google.com ([209.85.210.49]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lrgKD-005FcG-VI for linux-arm-kernel@lists.infradead.org; Fri, 11 Jun 2021 12:31:51 +0000 Received: by mail-ot1-f49.google.com with SMTP id h24-20020a9d64180000b029036edcf8f9a6so2982359otl.3 for ; 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=lqt7xVIzsg5GuWfy4PkEc97mh74OJlHWgiBtMKCzXKYWUNpMvMmHjzStuxVWqyS1qX EoSKzYZ/pIwceGDUykLtiqgQE5H0LvcLFYYKTAerf6WVY+O8uBFITVZyCtiy1qLw5Ms7 Cpc6JBdpfkmX1BEl5TaQRb2ogRZCY8B8DWkIS+AmTU6IXDd0LXUkLXixaDFElXlGisMa xSL3x5LrMEyu3Fn7gAM4M0NSkr5tLlwp8ysdXEcqgPL+orwrBlShFsn/0hhrlkl9tKz5 OswRgl7mle6d/qbAklsZzfwkSbJKbF9UXBUJh+gMVKdklBlVQmUVr3TDVvCZb4YwYIW0 OJzQ== X-Gm-Message-State: AOAM530GA7zcCHZepWsrdcZsRGEQFV+j3idZ+7oiSnMMNfMlNgXtX0gQ vIxlV1bAOvy58cwOMNoQjlX8T9qVjPt3sZM8hmo= 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210611_053150_031406_E267BE57 X-CRM114-Status: GOOD ( 23.07 ) 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 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. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel