Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp475014pxb; Wed, 20 Jan 2021 11:34:29 -0800 (PST) X-Google-Smtp-Source: ABdhPJzGwifrRyrOFcp9WIlsvvqo8kFEoMdKwz6rXQnbwo1OSW2+Do0cVcKpCtM7SPjTo6ktVCy2 X-Received: by 2002:aa7:db49:: with SMTP id n9mr8783009edt.73.1611171269594; Wed, 20 Jan 2021 11:34:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611171269; cv=none; d=google.com; s=arc-20160816; b=fGmXivYw8c20ch4BrdJap6qMgRAqwo+1xtgS9QS4jo0wjYhvroDzyRta/RrwEy2US/ AFpey6/oZWQJNymoyev7pz3uyybe6vQIpfpD8shhNVENhZJ9nO/xA3VPp07H7z5nFdaj kXucSh6qme5t9osStKYeAvUbZN/Rz7uIcvSmXLFuT40+FX6mRM6cAm3NjqPA+qSM5IXl UKbls1hT9OwiofyNSIDDc5BPJtKr7vCMklqLAGIuzZ32BRwJeLo+xR46rPWBMf1as7PX BHahHr2p8aZF+2NMd+3BVM204Ab8inj6Vhrd9fQ5usrFCDSCFKCrE+dKNtYjpIYea8h4 sUbQ== 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:dkim-signature; bh=4NjDehqz0VgBm2L8y0qfZbDJgiSQ3HAHgeBuj2A8VUE=; b=Ox+WvoFF7e9nqpId5NRLQ6T1wvUeu6gy0yI5yk40W4uG5ZZTSoN7S4rU6VC2Na4qZQ 3lzMKesyFht0eU3lR+JuFGzW/qtLgR0AhrhEc7S35pUIaJalltnr0mfasQnkoJ3RKIII YvSBVf/WDTRBzv1n//jj7tXnN/uS0qhDQ2AIMxV2VZbxHrjxyQT3ATn4UNRUN+vzGMlj 2Js1fOzVETHtnOSGk2Ig3SylKK5UFECiUQIr4XPmdSaakKWtOlgdSnJ/WgG2qldtNlsK e3OubRBugQGjEViD9MpAeiLhr7sniFWiEFP9o+1ys6Eit1jNfUtvAjGsA2qWv1Du4L2S Gubw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Ew80wgca; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id kd1si967231ejc.724.2021.01.20.11.34.04; Wed, 20 Jan 2021 11:34:29 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Ew80wgca; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388626AbhATTbr (ORCPT + 99 others); Wed, 20 Jan 2021 14:31:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51784 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388689AbhATSpp (ORCPT ); Wed, 20 Jan 2021 13:45:45 -0500 Received: from mail-pf1-x429.google.com (mail-pf1-x429.google.com [IPv6:2607:f8b0:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BE1CBC061795; Wed, 20 Jan 2021 10:44:41 -0800 (PST) Received: by mail-pf1-x429.google.com with SMTP id f63so7241921pfa.13; Wed, 20 Jan 2021 10:44:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=4NjDehqz0VgBm2L8y0qfZbDJgiSQ3HAHgeBuj2A8VUE=; b=Ew80wgcaPeRu4eGH9QGEtVnTO2VVqb4OOkFIowpw4AhsVGl/lFDyVUG/v6htZyPlYG vcZAk29nRUxj1cjXxqLNLywTlTuSkiCKoKN7Ode1kLfXHdpEtXd1qnV8MeRj/Uw0bvea zljoRfRy9jUqxrU2KB6s2KTVH+1U478kvx4/sNRjKCM48gwk8eviC1jP62HHOt/TSDOS 7wq1HCmvqQrVA45t3YkOzUvgxf3hMRFETvFeEBYIi1CdWxs10qaVRxgHQkIXT7mbVcLf OB6ci0CoX7/HVOAnmg9q0R01YslgykNumPlJp6ozHV4Q8Wk6KZtadB4oAUnSktIl7ypn +eoQ== 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=4NjDehqz0VgBm2L8y0qfZbDJgiSQ3HAHgeBuj2A8VUE=; b=bkOCA83uFtYQnmWu7us9JlRlk772hQGaJf727unbrWsB5hEgGblxKsyE2XAqCQ8qu9 U7WKUB9UtFPtZlPLB0fc2hAMiVptcuMWEDIA+KZ5d0vy5PDhTh9O1v77RSTiUeFfoXqF X+QN6b999JU4MbU0TlA+E6vE52HS7R9xmz9h6MlXomoytn0R1Q3HztQdImr0lPGfx0Wa N1i1yBMtNJIYDNDpjDDRyir4pH+Upa2nq3v4iVECXalxI8RIqsuQQz+LeWrrjTBdXq1l KH9qafXQdmvWHXTPnvZwSMX/kyFfSTUMzF3x0hkOqWeyuBV/HOeQIu0dmqN7q7Z+FJkA LgNQ== X-Gm-Message-State: AOAM532mW6QeWwHjcvXm2LeO4OsIhSAkpi093G/Hqv/cPhLrBynOVAlo tQAiGOLCPAWU3bJt79+5Y3AuyZ8xp/N3RtpMRg4= X-Received: by 2002:a65:644b:: with SMTP id s11mr10783324pgv.4.1611168281104; Wed, 20 Jan 2021 10:44:41 -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: Andy Shevchenko Date: Wed, 20 Jan 2021 20:45:30 +0200 Message-ID: Subject: Re: [net-next PATCH v3 09/15] device property: Introduce fwnode_get_id() To: "Rafael J. Wysocki" Cc: 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 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. -- With Best Regards, Andy Shevchenko