Re: [PATCH v8 09/22] ACPI: platform_profile: Use `scoped_cond_guard`

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



…
> +++ 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





[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]
  Powered by Linux