[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <7947c901-30a3-4e78-8877-08c8696bc84c@web.de>
Date: Sun, 1 Dec 2024 18:18:52 +0100
From: Markus Elfring <Markus.Elfring@....de>
To: Mario Limonciello <mario.limonciello@....com>,
 linux-acpi@...r.kernel.org, platform-driver-x86@...r.kernel.org,
 Hans de Goede <hdegoede@...hat.com>,
 Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>
Cc: LKML <linux-kernel@...r.kernel.org>,
 ibm-acpi-devel@...ts.sourceforge.net, Ai Chao <aichao@...inos.cn>,
 Alexis Belmonte <alexbelm48@...il.com>, Armin Wolf <W_Armin@....de>,
 Chun-Yi Lee <jlee@...e.com>, Corentin Chary <corentin.chary@...il.com>,
 Gergo Koteles <soyer@....hu>, Henrique de Moraes Holschuh <hmh@....eng.br>,
 Ike Panhc <ike.pan@...onical.com>, Len Brown <lenb@...nel.org>,
 "Luke D. Jones" <luke@...nes.dev>, Maximilian Luz <luzmaximilian@...il.com>,
 Mark Pearson <mpearson-lenovo@...ebb.ca>,
 Matthew Schwartz <matthew.schwartz@...ux.dev>,
 "Rafael J. Wysocki" <rafael@...nel.org>,
 Shyam Sundar S K <Shyam-sundar.S-k@....com>,
 Uwe Kleine-König <u.kleine-koenig@...libre.com>
Subject: Re: [PATCH v8 09/22] ACPI: platform_profile: Use `scoped_cond_guard`
…
> +++ b/drivers/acpi/platform_profile.c
> @@ -27,25 +27,20 @@ static ssize_t platform_profile_choices_show(struct device *dev,
>  					char *buf)
>  {
…
+		for_each_set_bit(i, cur_profile->choices, PLATFORM_PROFILE_LAST) {
+			if (len == 0)
+				len += sysfs_emit_at(buf, len, "%s", profile_names[i]);
+			else
+				len += sysfs_emit_at(buf, len, " %s", profile_names[i]);
+		}
…
How do you think about to integrate the following source code variant?
		for_each_set_bit(i, cur_profile->choices, PLATFORM_PROFILE_LAST)
			len += sysfs_emit_at(buf, len, (len ? " %s" : "%s"), profile_names[i]);
Regards,
Markus
Powered by blists - more mailing lists