mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: Andy Shevchenko <andy.shevchenko@gmail.com>,
	"Luke D. Jones" <luke@ljones.dev>
Cc: "Barnabás Pőcze" <pobrn@protonmail.com>,
	"Pavel Machek" <pavel@ucw.cz>,
	"Platform Driver" <platform-driver-x86@vger.kernel.org>,
	"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v3 5/6] asus-wmi: Convert all attr-show to use sysfs_emit
Date: Thu, 11 Aug 2022 20:52:09 +0200	[thread overview]
Message-ID: <adaf33ba-b9dd-8ed3-a55e-40fded404fea@redhat.com> (raw)
In-Reply-To: <CAHp75VdoqPOZz4GG6Sr2npZwjYHDVMo2pmNGqyBRrnen2j8k7g@mail.gmail.com>

Hi,

On 8/9/22 11:27, Andy Shevchenko wrote:
> On Tue, Aug 9, 2022 at 4:51 AM Luke D. Jones <luke@ljones.dev> wrote:
>>
>> This changes all *_show attributes in asus-wmi.c to use sysfs_emit()
>> instead of the older method of writing to the output buffer manually.
> 
> This looks good to me,
> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
> 
> (Carry the tag with a new version of the series in this patch)
> 
> Hans, I guess this one can be applied so it will be less of a burden
> on reviewing the rest.

Thanks for the review. I agree that this one can be merged
already, so I have just merged it:

Thank you for your patch, I've applied this patch to my review-hans 
branch:
https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/log/?h=review-hans

Note it will show up in my review-hans branch once I've pushed my
local branch there, which might take a while.

Patches which are added to review-hans now are intended for
the next rc1. This branch will get rebased to the next rc1 when
it is out and after the rebasing the contents of review-hans
will be pushed to the platform-drivers-x86/for-next branch.

Regards,

Hans


> 
>> Signed-off-by: Luke D. Jones <luke@ljones.dev>
>> ---
>>  drivers/platform/x86/asus-wmi.c | 14 +++++++-------
>>  1 file changed, 7 insertions(+), 7 deletions(-)
>>
>> diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
>> index 719223804c0e..78f1f3af1b12 100644
>> --- a/drivers/platform/x86/asus-wmi.c
>> +++ b/drivers/platform/x86/asus-wmi.c
>> @@ -942,7 +942,7 @@ static ssize_t charge_control_end_threshold_show(struct device *device,
>>                                                  struct device_attribute *attr,
>>                                                  char *buf)
>>  {
>> -       return sprintf(buf, "%d\n", charge_end_threshold);
>> +       return sysfs_emit(buf, "%d\n", charge_end_threshold);
>>  }
>>
>>  static DEVICE_ATTR_RW(charge_control_end_threshold);
>> @@ -2032,7 +2032,7 @@ static ssize_t pwm1_show(struct device *dev,
>>                 value = -1;
>>         }
>>
>> -       return sprintf(buf, "%d\n", value);
>> +       return sysfs_emit(buf, "%d\n", value);
>>  }
>>
>>  static ssize_t pwm1_store(struct device *dev,
>> @@ -2092,7 +2092,7 @@ static ssize_t fan1_input_show(struct device *dev,
>>                 return -ENXIO;
>>         }
>>
>> -       return sprintf(buf, "%d\n", value < 0 ? -1 : value*100);
>> +       return sysfs_emit(buf, "%d\n", value < 0 ? -1 : value * 100);
>>  }
>>
>>  static ssize_t pwm1_enable_show(struct device *dev,
>> @@ -2110,7 +2110,7 @@ static ssize_t pwm1_enable_show(struct device *dev,
>>          * in practice on X532FL at least (the bit is always 0) and there's
>>          * also nothing in the DSDT to indicate that this behaviour exists.
>>          */
>> -       return sprintf(buf, "%d\n", asus->fan_pwm_mode);
>> +       return sysfs_emit(buf, "%d\n", asus->fan_pwm_mode);
>>  }
>>
>>  static ssize_t pwm1_enable_store(struct device *dev,
>> @@ -2178,7 +2178,7 @@ static ssize_t fan1_label_show(struct device *dev,
>>                                           struct device_attribute *attr,
>>                                           char *buf)
>>  {
>> -       return sprintf(buf, "%s\n", ASUS_FAN_DESC);
>> +       return sysfs_emit(buf, "%s\n", ASUS_FAN_DESC);
>>  }
>>
>>  static ssize_t asus_hwmon_temp1(struct device *dev,
>> @@ -2371,7 +2371,7 @@ static ssize_t fan_boost_mode_show(struct device *dev,
>>  {
>>         struct asus_wmi *asus = dev_get_drvdata(dev);
>>
>> -       return scnprintf(buf, PAGE_SIZE, "%d\n", asus->fan_boost_mode);
>> +       return sysfs_emit(buf, "%d\n", asus->fan_boost_mode);
>>  }
>>
>>  static ssize_t fan_boost_mode_store(struct device *dev,
>> @@ -2924,7 +2924,7 @@ static ssize_t throttle_thermal_policy_show(struct device *dev,
>>         struct asus_wmi *asus = dev_get_drvdata(dev);
>>         u8 mode = asus->throttle_thermal_policy_mode;
>>
>> -       return scnprintf(buf, PAGE_SIZE, "%d\n", mode);
>> +       return sysfs_emit(buf, "%d\n", mode);
>>  }
>>
>>  static ssize_t throttle_thermal_policy_store(struct device *dev,
>> --
>> 2.37.1
>>
> 
> 


  reply	other threads:[~2022-08-11 18:52 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-09  2:50 [PATCH v3 0/6] asus-wmi: Add support for RGB keyboards Luke D. Jones
2022-08-09  2:50 ` [PATCH v3 1/6] asus-wmi: Implement TUF laptop keyboard RGB control Luke D. Jones
2022-08-09  8:46   ` Andy Shevchenko
2022-08-09  8:55     ` Luke Jones
2022-08-09  9:29       ` Andy Shevchenko
2022-08-09  9:31         ` Luke Jones
2022-08-09 10:50   ` Pavel Machek
2022-08-10  4:44     ` Luke Jones
2022-08-11 15:01       ` Hans de Goede
2022-08-11 15:05         ` Hans de Goede
2022-08-11 22:13           ` Luke Jones
2022-08-09  2:50 ` [PATCH v3 2/6] asus-wmi: Implement TUF laptop keyboard LED modes Luke D. Jones
2022-08-09  3:16   ` Luke Jones
2022-08-09  9:22   ` Andy Shevchenko
2022-08-09  9:30     ` Luke Jones
2022-08-09  2:50 ` [PATCH v3 3/6] asus-wmi: Implement TUF laptop keyboard power states Luke D. Jones
2022-08-09  8:52   ` Andy Shevchenko
2022-08-09  8:58     ` Luke Jones
2022-08-09  2:50 ` [PATCH v3 4/6] asus-wmi: Document previously added attributes Luke D. Jones
2022-08-09  9:25   ` Andy Shevchenko
2022-08-11 15:08     ` Hans de Goede
2022-08-11 22:08       ` Luke Jones
2022-08-09  2:50 ` [PATCH v3 5/6] asus-wmi: Convert all attr-show to use sysfs_emit Luke D. Jones
2022-08-09  9:27   ` Andy Shevchenko
2022-08-11 18:52     ` Hans de Goede [this message]
2022-08-09  2:50 ` [PATCH v3 6/6] asus-wmi: Support the hardware GPU MUX on some laptops Luke D. Jones
2022-08-09  7:19   ` Luke Jones
2022-08-11 13:53   ` Hans de Goede
2022-08-11 22:01     ` Luke Jones
2022-08-12  7:59       ` Hans de Goede
2022-08-12  8:31         ` Thomas Weißschuh
2022-08-12  8:44           ` Hans de Goede
2022-08-09  8:55 ` [PATCH v3 0/6] asus-wmi: Add support for RGB keyboards Andy Shevchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=adaf33ba-b9dd-8ed3-a55e-40fded404fea@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luke@ljones.dev \
    --cc=pavel@ucw.cz \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=pobrn@protonmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®