lkml.org 
[lkml]   [2022]   [Nov]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] drm/i915: use sysfs emit() to instead of scnprintf()
From: ye xingchen <ye.xingchen@zte.com.cn>

Replace the open-code with sysfs_emit() to simplify the code.

Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn>
---
drivers/gpu/drm/i915/i915_mitigations.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_mitigations.c b/drivers/gpu/drm/i915/i915_mitigations.c
index def7302ef7fe..2b7aaaefb3a9 100644
--- a/drivers/gpu/drm/i915/i915_mitigations.c
+++ b/drivers/gpu/drm/i915/i915_mitigations.c
@@ -102,10 +102,10 @@ static int mitigations_get(char *buffer, const struct kernel_param *kp)
bool enable;

if (!local)
- return scnprintf(buffer, PAGE_SIZE, "%s\n", "off");
+ return sysfs_emit(buffer, "%s\n", "off");

if (local & BIT(BITS_PER_LONG - 1)) {
- count = scnprintf(buffer, PAGE_SIZE, "%s,", "auto");
+ count = sysfs_emit(buffer, "%s,", "auto");
enable = false;
} else {
enable = true;
--
2.25.1
\
 
 \ /
  Last update: 2022-12-01 03:54    [W:0.032 / U:0.184 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site