Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp763173pxb; Wed, 29 Sep 2021 09:11:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzKRZ/Hz6Q7ZEm6PTFh3JyIcP/DDs1CpsneABLkttEnLC1bebrX+Ialf7Xg7pDlltTuRpVA X-Received: by 2002:a17:906:b183:: with SMTP id w3mr603171ejy.394.1632931862638; Wed, 29 Sep 2021 09:11:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632931862; cv=none; d=google.com; s=arc-20160816; b=yWIeL1FbBkiFxYcGCHqQoabENc1dI7GnYa+i0J5y/KU/4VNmh8ps0SXiDuLUNEyT4a /LXZXnzjkAAVMRlHDwRVEmNwKiZ3bkdc7wstspif8NV7Y5VWnxtvN9sS1gPFDawyt2PW wdhp/QUIHvYdmH7jf1Hl0JazarPsbn3EBIg9i8V0hcn1JaWTN8ACex9Pp/vt7PeKIvP+ MoKx26DXyq/q938r0MaZKURZGoRcmWcuLpTkYN8btG9NHQmf+jPT5C/6EpfFr7D7TL5O OT2z8Dm4bBEszZp+WpPbzWjTDnGihbQ1kD+SE2Y3c4ypblkaWZMR5rpEToqmSyRO+vPU /g2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=RhEwLjH+6DRijdIR2kBqHdJMqJ5dxHer2ZAdAneqDLE=; b=jJ7w11SA16RQttJ5dDSDisTSKT0wxnaKdy30VFN0/UIxOC3RDkDAD2Qb3Mnon4yVDh C4ZTIfV6oSbgf8zLp89aeuQRqPdo43qRvLwc1cY2B0m1heDkqvbSL9BFXzGL4cCazUcV GsTHYeUyDSkRS6wTWK/IW57/YkiA8aHTuPaKt1FAK1NOClzq1H/rEao2Nx3PmCVsVZj5 8ZbRYoWp2QfKDFVTUekksjBASEAFrizwYqHFhGrVO5AGE0TnRbskdlt/EBICwgSYbTjR ophNTc4/eBBlo8OsFJvzBKykD6d7oPk2wvNa7MoE8piq9Q73ucraLuNXUDJBRd0ZYN7Q AyAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=NNrLehk8; 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=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k3si359141edx.240.2021.09.29.09.10.36; Wed, 29 Sep 2021 09:11:02 -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; dkim=pass header.i=@chromium.org header.s=google header.b=NNrLehk8; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345679AbhI2QKG (ORCPT + 99 others); Wed, 29 Sep 2021 12:10:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37828 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344876AbhI2QJ5 (ORCPT ); Wed, 29 Sep 2021 12:09:57 -0400 Received: from mail-pj1-x1029.google.com (mail-pj1-x1029.google.com [IPv6:2607:f8b0:4864:20::1029]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 69955C061760 for ; Wed, 29 Sep 2021 09:02:20 -0700 (PDT) Received: by mail-pj1-x1029.google.com with SMTP id h12so2031525pjj.1 for ; Wed, 29 Sep 2021 09:02:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=RhEwLjH+6DRijdIR2kBqHdJMqJ5dxHer2ZAdAneqDLE=; b=NNrLehk8yXWKKBKC0MGdRutYWv0rsiTlAgbOWdVCpZIYmkQeVATvxvJkrkNuvvaSyJ yvnw3mhl0Gxnzj2otpnT32PHm82/a4yv/Jq9XmbafGTJ0z9pnvXddzaEjTDjq0OmLxEl yGoJsbtQrRe/UPtVD3dRM1znAb/wUpMoPkyYI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=RhEwLjH+6DRijdIR2kBqHdJMqJ5dxHer2ZAdAneqDLE=; b=73BYL4WNC2oF5ZhSrgWF87Em4a+Fnp3Qe6tVaf9it1pscVcgal7p1hTPrY9RG5rcwS LpRv/AqBq3iC3H4qDjTj3twF4E1cQrSWV9NIouny0SQe6votGAKjr3TKBSK5u88IdtXp AVTl43mOvKLOPEYJbq1D/GHzgn1/5Jun29YbQGZFIwyB3o/e8cBLAfOGmB2y0ExUNuTp qxDYYZdV3XsOXU/HeFZKbJDGrfcvjS+PL+SZ2a0gyzubme0hJzcstMZt+luypeh4OGP0 GnGm0po0guiziDpJf6FNTqo2Ao7ICdY3RS9kYFKOpgideNvnj7FqJVgypZGm9qlZUWzB KLfg== X-Gm-Message-State: AOAM530Jz36CZCh1Jhj7IMU8REe9RS3stc9ZXgwRWdpyFHF14umBXEA1 J3dppd7+Wzl9P3Jqezml35Y/53tBJXnOKQ== X-Received: by 2002:a17:903:2451:b0:13b:9694:4ea3 with SMTP id l17-20020a170903245100b0013b96944ea3mr670463pls.74.1632931339985; Wed, 29 Sep 2021 09:02:19 -0700 (PDT) Received: from localhost ([2620:15c:202:201:2f10:2763:4825:1f01]) by smtp.gmail.com with UTF8SMTPSA id e9sm181547pjl.41.2021.09.29.09.02.18 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 29 Sep 2021 09:02:19 -0700 (PDT) Date: Wed, 29 Sep 2021 09:02:17 -0700 From: Matthias Kaehlcke To: Geert Uytterhoeven Cc: Sebastian Reichel , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Tom Rix , SeongJae Park Subject: Re: [PATCH] power: supply: core: Move psy_has_property() to fix build Message-ID: References: <7b35a74f2c2ad19c8dc1ca60c59e48a14288677f.1632830348.git.geert+renesas@glider.be> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <7b35a74f2c2ad19c8dc1ca60c59e48a14288677f.1632830348.git.geert+renesas@glider.be> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 28, 2021 at 02:00:19PM +0200, Geert Uytterhoeven wrote: > If CONFIG_THERMAL=n: > > drivers/power/supply/power_supply_core.c: In function ‘__power_supply_register’: > drivers/power/supply/power_supply_core.c:1137:6: error: implicit declaration of function ‘psy_has_property’ [-Werror=implicit-function-declaration] > 1137 | if (psy_has_property(desc, POWER_SUPPLY_PROP_USB_TYPE) && > | ^~~~~~~~~~~~~~~~ > > Fix this by moving psy_has_property() outside the section protected by > CONFIG_THERMAL. > > Fixes: 9ba533eb99bb2acf ("power: supply: core: Add psy_has_property()") > Signed-off-by: Geert Uytterhoeven > --- > drivers/power/supply/power_supply_core.c | 32 ++++++++++++------------ > 1 file changed, 16 insertions(+), 16 deletions(-) > > diff --git a/drivers/power/supply/power_supply_core.c b/drivers/power/supply/power_supply_core.c > index 75575ea45f21ddc7..fc12a4f407f431a6 100644 > --- a/drivers/power/supply/power_supply_core.c > +++ b/drivers/power/supply/power_supply_core.c > @@ -951,6 +951,22 @@ void power_supply_unreg_notifier(struct notifier_block *nb) > } > EXPORT_SYMBOL_GPL(power_supply_unreg_notifier); > > +static bool psy_has_property(const struct power_supply_desc *psy_desc, > + enum power_supply_property psp) > +{ > + bool found = false; > + int i; > + > + for (i = 0; i < psy_desc->num_properties; i++) { > + if (psy_desc->properties[i] == psp) { > + found = true; > + break; > + } > + } > + > + return found; > +} > + > #ifdef CONFIG_THERMAL > static int power_supply_read_temp(struct thermal_zone_device *tzd, > int *temp) > @@ -975,22 +991,6 @@ static struct thermal_zone_device_ops psy_tzd_ops = { > .get_temp = power_supply_read_temp, > }; > > -static bool psy_has_property(const struct power_supply_desc *psy_desc, > - enum power_supply_property psp) > -{ > - bool found = false; > - int i; > - > - for (i = 0; i < psy_desc->num_properties; i++) { > - if (psy_desc->properties[i] == psp) { > - found = true; > - break; > - } > - } > - > - return found; > -} > - > static int psy_register_thermal(struct power_supply *psy) > { > int ret; Thanks for the fix! Reviewed-by: Matthias Kaehlcke