Skip to content

Commit 92266c6

Browse files
ye xingchenrafaeljw
authored andcommitted
ACPI: use sysfs_emit() instead of scnprintf()
Replace the open-code with sysfs_emit() to simplify the code. Signed-off-by: ye xingchen <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent ebb92d5 commit 92266c6

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

drivers/acpi/acpi_pad.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ static ssize_t rrtime_store(struct device *dev,
287287
static ssize_t rrtime_show(struct device *dev,
288288
struct device_attribute *attr, char *buf)
289289
{
290-
return scnprintf(buf, PAGE_SIZE, "%d\n", round_robin_time);
290+
return sysfs_emit(buf, "%d\n", round_robin_time);
291291
}
292292
static DEVICE_ATTR_RW(rrtime);
293293

@@ -309,7 +309,7 @@ static ssize_t idlepct_store(struct device *dev,
309309
static ssize_t idlepct_show(struct device *dev,
310310
struct device_attribute *attr, char *buf)
311311
{
312-
return scnprintf(buf, PAGE_SIZE, "%d\n", idle_pct);
312+
return sysfs_emit(buf, "%d\n", idle_pct);
313313
}
314314
static DEVICE_ATTR_RW(idlepct);
315315

drivers/acpi/cppc_acpi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ __ATTR(_name, 0444, show_##_name, NULL)
148148
if (ret) \
149149
return ret; \
150150
\
151-
return scnprintf(buf, PAGE_SIZE, "%llu\n", \
151+
return sysfs_emit(buf, "%llu\n", \
152152
(u64)st_name.member_name); \
153153
} \
154154
define_one_cppc_ro(member_name)
@@ -174,7 +174,7 @@ static ssize_t show_feedback_ctrs(struct kobject *kobj,
174174
if (ret)
175175
return ret;
176176

177-
return scnprintf(buf, PAGE_SIZE, "ref:%llu del:%llu\n",
177+
return sysfs_emit(buf, "ref:%llu del:%llu\n",
178178
fb_ctrs.reference, fb_ctrs.delivered);
179179
}
180180
define_one_cppc_ro(feedback_ctrs);

0 commit comments

Comments
 (0)