Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp249825pxb; Thu, 30 Sep 2021 05:24:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxuHgZPEu57u7W2WC6f0UzxNnJSpba+YGbOeAFj9eSA6MNNBGNcOEEJGhmfUf1s6b32Q0/8 X-Received: by 2002:a17:902:7043:b0:13e:1007:3d6d with SMTP id h3-20020a170902704300b0013e10073d6dmr3954173plt.79.1633004654964; Thu, 30 Sep 2021 05:24:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633004654; cv=none; d=google.com; s=arc-20160816; b=Avib7KYkol6ZnZsPKmTgSFzp631CVGL2luFnJyObrjaBujl6obVcVV6TbF57NaWSeP vC4tbRvD0lAOkFf5aK30wpcTl2tQ5Z7fH6cJLp50oZ1j2f//UFk+imzLRT0Rwzataa/n vVIybHoW+ej7pHTEpzZuuyEmNOYsIK9HoRTGnOLkxuW4pPohoqHA6kTeF98zu5xScy2A +4cXSzLJqI+xHY8kPSRFYZHFhNmN3eqvzcuXvYySTMbq2KD/XzVCywaugcGTlO6DMt6J 6M+BNAE2Le0IVM+cyJedq30BygJcZvr/HI0tbpIaZfMf1X7L5ufKck1Bc/jdzrE7Wes9 Jn2A== 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-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=UZGkUNOwXF1okDKKcdLF42Ad+GY5/LdpCn7wFJeX4mI=; b=d3FJsvndphMhjZC1x0RDRV7lTZEZF8Js/TPou+rgEOdmQv2sNs9dI6jId08bW0udOa nbAzPXGWYnxUP1xXOBmi9/DaBVd+9r9crICpsvdjByb386jjlEGIkNiwcUu+7XWI2bBW srDG87aD+Avi/qvpSek4fU1+E2bpGwAs6QDTmJf7GSayRgIUpHWw64W94FjiIMfObxyG Z4uW8qHfKak9mjGjEyjK8Yrk5/c+e64NG9i5hSGnfJmlERoJxC9wqEFg6+VmWZKb4KZO TSMK/X62fsH+qsq1lX/5kQS1WWHvBRLMQCXcWAVYQkLPrhHt0P3D2laO2dA+Ly2xGQzO FRFA== 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=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w22si4012230pll.238.2021.09.30.05.23.56; Thu, 30 Sep 2021 05:24:14 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350128AbhI3KwH (ORCPT + 99 others); Thu, 30 Sep 2021 06:52:07 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:60148 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350127AbhI3KwG (ORCPT ); Thu, 30 Sep 2021 06:52:06 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: sre) with ESMTPSA id 111741F44AD2 Received: by earth.universe (Postfix, from userid 1000) id 9E77A3C0CA8; Thu, 30 Sep 2021 12:50:19 +0200 (CEST) Date: Thu, 30 Sep 2021 12:50:19 +0200 From: Sebastian Reichel To: Matthias Kaehlcke Cc: Geert Uytterhoeven , 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: <20210930105019.h7jhfjr5hkmzhh6e@earth.universe> References: <7b35a74f2c2ad19c8dc1ca60c59e48a14288677f.1632830348.git.geert+renesas@glider.be> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="zfv6tookm75yhkib" Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --zfv6tookm75yhkib Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, On Wed, Sep 29, 2021 at 09:02:17AM -0700, Matthias Kaehlcke wrote: > On Tue, Sep 28, 2021 at 02:00:19PM +0200, Geert Uytterhoeven wrote: > > If CONFIG_THERMAL=3Dn: > >=20 > > drivers/power/supply/power_supply_core.c: In function =E2=80=98__po= wer_supply_register=E2=80=99: > > drivers/power/supply/power_supply_core.c:1137:6: error: implicit de= claration of function =E2=80=98psy_has_property=E2=80=99 [-Werror=3Dimplici= t-function-declaration] > > 1137 | if (psy_has_property(desc, POWER_SUPPLY_PROP_USB_TYPE) && > > | ^~~~~~~~~~~~~~~~ > >=20 > > Fix this by moving psy_has_property() outside the section protected by > > CONFIG_THERMAL. > >=20 > > Fixes: 9ba533eb99bb2acf ("power: supply: core: Add psy_has_property()") > > Signed-off-by: Geert Uytterhoeven > > --- Thanks, queued. -- Sebastian > > drivers/power/supply/power_supply_core.c | 32 ++++++++++++------------ > > 1 file changed, 16 insertions(+), 16 deletions(-) > >=20 > > diff --git a/drivers/power/supply/power_supply_core.c b/drivers/power/s= upply/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_b= lock *nb) > > } > > EXPORT_SYMBOL_GPL(power_supply_unreg_notifier); > > =20 > > +static bool psy_has_property(const struct power_supply_desc *psy_desc, > > + enum power_supply_property psp) > > +{ > > + bool found =3D false; > > + int i; > > + > > + for (i =3D 0; i < psy_desc->num_properties; i++) { > > + if (psy_desc->properties[i] =3D=3D psp) { > > + found =3D 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 = =3D { > > .get_temp =3D power_supply_read_temp, > > }; > > =20 > > -static bool psy_has_property(const struct power_supply_desc *psy_desc, > > - enum power_supply_property psp) > > -{ > > - bool found =3D false; > > - int i; > > - > > - for (i =3D 0; i < psy_desc->num_properties; i++) { > > - if (psy_desc->properties[i] =3D=3D psp) { > > - found =3D true; > > - break; > > - } > > - } > > - > > - return found; > > -} > > - > > static int psy_register_thermal(struct power_supply *psy) > > { > > int ret; >=20 > Thanks for the fix! >=20 > Reviewed-by: Matthias Kaehlcke --zfv6tookm75yhkib Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEE72YNB0Y/i3JqeVQT2O7X88g7+poFAmFVlmQACgkQ2O7X88g7 +pp5+Q/7BHTkk5ug8j0lEOXPCT3yz+z8fDcNqfQOiwpw8eqB4sF+xTynMJ9jp9gF dhkrIBKaaOOlkz79W6s/YZ8lzZv913+cr8cfsBE8M2p/4d9zTqZaDv7D6ImrF3CY Ru+/uWNQqULuzn2+Yjnf3IdEyTw5BIidXT+ae7rY2Y5i0a+bHpIpMQ20RAZvmy/v 6LMhQp1ZcT8DTxqICBzJLJCX88db7FTH8GSEq64YLfavjaYKOW3gvq9+wVAPwG71 gdv9DvmNq681BoSpMoSV8Dm0HaDTmTZK8EFfohkpKdp9amc2fU/vhF1IceEMS+W5 yyqVGRTNimKbmX8xlUNTwfTrKpS/5t8UCBzIshXl+KPTnEwBNBFbi4fed1g2N+76 CF+PJIY1S/lx+ZZ+ajrFwFt8IdFHT433mO12MiJBzMU+IzoLEf/fNrR1G0z5FSrG UxZwOCkTduUNY8rrZcOcpO1Emtr1YCcKTGfhzOK8b5vOJFU95ng57Y3yhJihL1HV Hdb7f3Em42mvZK6X9CYZLUR6b5SmmkGzAtLUad8C8uqYyh6hd9ttp7FRgWF+lRHe RQPfsE2u2IAm+e+RHWqgIP/eaBF3SXzOENyEz9iIwzySrdGOzRiQzZtLvkkaZqPr ONCGTP0IBzjtcPyJdCizupSORkwxbwSKUC9HWaX+N3YcRDk9/Bo= =Zayd -----END PGP SIGNATURE----- --zfv6tookm75yhkib--