linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Luke D. Jones" <luke@ljones.dev>
To: hdegoede@redhat.com
Cc: markgross@kernel.org, platform-driver-x86@vger.kernel.org,
	linux-kernel@vger.kernel.org, "Luke D. Jones" <luke@ljones.dev>
Subject: [PATCH 5/5] asus-wmi: Convert all attr _show to use sysfs_emit
Date: Fri,  5 Aug 2022 20:19:09 +1200	[thread overview]
Message-ID: <20220805081909.10962-6-luke@ljones.dev> (raw)
In-Reply-To: <20220805081909.10962-1-luke@ljones.dev>

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 ad758845edc0..1e1b5226e0b3 100644
--- a/drivers/platform/x86/asus-wmi.c
+++ b/drivers/platform/x86/asus-wmi.c
@@ -914,7 +914,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);
@@ -2021,7 +2021,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,
@@ -2081,7 +2081,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,
@@ -2099,7 +2099,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,
@@ -2167,7 +2167,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,
@@ -2360,7 +2360,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,
@@ -2913,7 +2913,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


  parent reply	other threads:[~2022-08-05  8:20 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-05  8:19 [PATCH 0/5] asus-wmi: Add support for RGB keyboards Luke D. Jones
2022-08-05  8:19 ` [PATCH 1/5] asus-wmi: Add basic support for TUF laptop keyboard RGB Luke D. Jones
2022-08-06  9:44   ` Andy Shevchenko
2022-08-06 10:16     ` Luke Jones
2022-08-06 10:27       ` Andy Shevchenko
2022-08-06 10:27         ` Andy Shevchenko
2022-08-06 17:30   ` Barnabás Pőcze
2022-08-07  1:54     ` Luke Jones
2022-08-05  8:19 ` [PATCH 2/5] asus-wmi: Add support for TUF laptop keyboard RGB mode control Luke D. Jones
2022-08-06  9:56   ` Andy Shevchenko
2022-08-06 10:33     ` Luke Jones
2022-08-06 11:12       ` Andy Shevchenko
2022-08-05  8:19 ` [PATCH 3/5] asus-wmi: Add support for TUF laptop keyboard states Luke D. Jones
2022-08-05 12:08   ` Pavel Machek
2022-08-05 21:29     ` Luke Jones
2022-08-07  7:44     ` Luke Jones
2022-08-07 12:41       ` Pavel Machek
2022-08-09 23:03         ` Luke Jones
2022-08-05  8:19 ` [PATCH 4/5] asus-wmi: Document many of the undocumented API Luke D. Jones
2022-08-05 21:43   ` kernel test robot
2022-08-06 10:00   ` Andy Shevchenko
2022-08-05  8:19 ` Luke D. Jones [this message]
2022-08-06 10:05   ` [PATCH 5/5] asus-wmi: Convert all attr _show to use sysfs_emit Andy Shevchenko
2022-08-05 12:05 ` [PATCH 0/5] asus-wmi: Add support for RGB keyboards Pavel Machek
2022-08-05 21:30   ` Luke Jones
2022-08-06  9:10 ` Andy Shevchenko
2022-08-06  9:32   ` Luke Jones
2022-08-06  9:48     ` Andy Shevchenko
2022-08-06 10:02     ` Andy Shevchenko
2022-08-06 10:48       ` Luke Jones
2022-08-06 11:16         ` 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=20220805081909.10962-6-luke@ljones.dev \
    --to=luke@ljones.dev \
    --cc=hdegoede@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=markgross@kernel.org \
    --cc=platform-driver-x86@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).