Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp463640pxb; Wed, 20 Jan 2021 11:16:26 -0800 (PST) X-Google-Smtp-Source: ABdhPJxKHaau8FK3VkXX+6+yWjybuFGekUoqKPcGLD5U+ed81riWatmABPKeiP5lD3ZoKfBJMEH5 X-Received: by 2002:aa7:d603:: with SMTP id c3mr8276511edr.337.1611170186183; Wed, 20 Jan 2021 11:16:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611170186; cv=none; d=google.com; s=arc-20160816; b=PttpdKX81ZaWXo1nmeDW1mp36tz8kRQteG5Zq7AoawhNdDcIzf5euRUx07FFdAV/Kr sifX/DC2ixKpeF2X2zEt9SO8YBUB4pFHeGlLrEWIu0htjslc2Bbc88/QkLSz43ZFpfpR afeQsdQvF2mNQyphgKBeqSw8sMtCt8+a9ZztiSdTcedX9+hBfkwG82FycNfiYGiZgexn ZllSbcJ8rJ+YhUwJU8445j9H33yE3jCC9Vd2j6NuVfrGw1ihcR5y6q+Er2dSimnGoLL7 TU3N1FhqDL+tJxgPnFEZj3d9bv+YGrBbIb5B1BLnJqGyGLMBfNGJOLjt+jwy72sd7Rp5 viFw== 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=MBnGinpLx/odbS3fMalb2PzzBTxTBoYrscYbO4dcTx4=; b=SHFU65wmM54oXZHeaeNFRmKaAoP//oj0GBb1JSmsKAnMsWJezqRVEOFoXT0Ki2u3Zk IyjTMLtWFG8o5h69plQ4FjNj9DUhuxx/hT1Dwyl6Dks5kSZBol50GDEbjYzAEF2aecR4 oUroxvmCp9R5lLu1Yi5cJFL6GqGCq6r6lrVBJcxguW5R9eLilZFuy1ifzw99NKmHAFy7 qL+WGivT3upKLDnzkIG+/qmFJPmrmxgSYTVTpRZsO4XqAw0365r95m7UKe/++lUoJ+Pw Hkwl9NmjBZxd6lpi6eG9s8XT4CtpcwrJlNgHm/VUrVXXZHkilYq5nNxwqHVLLhPwikCb oOsQ== 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 b1si1032064ejb.314.2021.01.20.11.15.59; Wed, 20 Jan 2021 11:16:26 -0800 (PST) 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 S2392148AbhATTOO (ORCPT + 99 others); Wed, 20 Jan 2021 14:14:14 -0500 Received: from mail-wm1-f42.google.com ([209.85.128.42]:38206 "EHLO mail-wm1-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388578AbhATTNo (ORCPT ); Wed, 20 Jan 2021 14:13:44 -0500 Received: by mail-wm1-f42.google.com with SMTP id y187so3807021wmd.3; Wed, 20 Jan 2021 11:13:28 -0800 (PST) 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=MBnGinpLx/odbS3fMalb2PzzBTxTBoYrscYbO4dcTx4=; b=jQK8KsomxkfnpfpF06mYjwHfydEhZZRMxmpaztn9NkUx54MfEK9fn9wocyoa1BbVzt YW1La+uX/oiAQCLmr5ZpNZTpmySgblUJyuYpmkTnGe4aPM2U2mvXFgElHDqlyct2V45U cjMAPCbch1jICD3HqdjgveCuw+VxZ+YxfgZo55fPPxszNNPJwZtotvt5nwbZCWAde9Ol hx8RpgaMedSXfmYUbMhgGob4A13g177bHE8J8Vw6twC2ooBArPUfeQChlazn/3dZxXSz VitUO0K8ej/iG/7nelG33ZTHKLN1cEJmqXjoW97xnM47laEPY5Oi+uEBprMlFZL526k/ sOEg== X-Gm-Message-State: AOAM5307vz7dJHGgOy4N5jjq62h1jE3cNC+rwzPAQOZwZb/yo9YQe9yy ot5MPwJ1miARJQIO0jJvUMblkqNS6zD2489tiq8= X-Received: by 2002:a1c:a593:: with SMTP id o141mr5723964wme.92.1611169982589; Wed, 20 Jan 2021 11:13:02 -0800 (PST) MIME-Version: 1.0 References: <20210112134054.342-1-calvin.johnson@oss.nxp.com> <20210112134054.342-10-calvin.johnson@oss.nxp.com> In-Reply-To: From: "Rafael J. Wysocki" Date: Wed, 20 Jan 2021 20:12:26 +0100 Message-ID: Subject: Re: [net-next PATCH v3 09/15] device property: Introduce fwnode_get_id() To: Andy Shevchenko Cc: "Rafael J. Wysocki" , Calvin Johnson , Grant Likely , Jeremy Linton , Andrew Lunn , Florian Fainelli , Russell King - ARM Linux admin , Cristi Sovaiala , Florin Laurentiu Chiculita , Ioana Ciornei , Madalin Bucur , Heikki Krogerus , Marcin Wojtas , Pieter Jansen Van Vuuren , Jon , Diana Madalina Craciun , Linux Kernel Mailing List , netdev , Laurentiu Tudor , ACPI Devel Maling List , "linux.cj" , linux-arm Mailing List , Andy Shevchenko , Bartosz Golaszewski , Greg Kroah-Hartman , Laurent Pinchart , Randy Dunlap , Saravana Kannan Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 20, 2021 at 7:44 PM Andy Shevchenko wrote: > > On Wed, Jan 20, 2021 at 8:18 PM Rafael J. Wysocki wrote: > > On Tue, Jan 12, 2021 at 4:47 PM Andy Shevchenko > > wrote: > > > On Tue, Jan 12, 2021 at 3:42 PM Calvin Johnson > > > wrote: > > ... > > > > > +int fwnode_get_id(struct fwnode_handle *fwnode, u32 *id) > > > > +{ > > > > +#ifdef CONFIG_ACPI > > > > + unsigned long long adr; > > > > + acpi_status status; > > > > +#endif > > > > + int ret; > > > > + > > > > + ret = fwnode_property_read_u32(fwnode, "reg", id); > > > > + if (!(ret && is_acpi_node(fwnode))) > > > > + return ret; > > > > + > > > > +#ifdef CONFIG_ACPI > > > > + status = acpi_evaluate_integer(ACPI_HANDLE_FWNODE(fwnode), > > > > + METHOD_NAME__ADR, NULL, &adr); > > > > + if (ACPI_FAILURE(status)) > > > > + return -EINVAL; > > > > + *id = (u32)adr; > > > > > > Shouldn't be > > > > > > return 0; > > > #else > > > return -EINVAL; > > > #endif > > > > > > ? > > > > > > Yes, it's a theoretical case when is_acpi_node() returns true when > > > CONFIG_ACPI=n. > > > > How so? is_acpi_node() is defined as a static inline returning false then. > > I understand that, that's why it's pure theoretical when, for example, > the semantics is changed. But I believe it's unlucky to happen. Changing the definition of it for CONFIG_ACPI=n would be a regression given the current usage of it.