Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-gfx] [PATCH] drm/i915: use sysfs_emit() to instead of scnprintf()
@ 2022-12-01  2:53 ye.xingchen
  2022-12-01 17:00 ` [Intel-gfx] ✓ Fi.CI.BAT: success for " Patchwork
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: ye.xingchen @ 2022-12-01  2:53 UTC (permalink / raw)
  To: joonas.lahtinen
  Cc: intel-gfx, linux-kernel, dri-devel, daniel, rodrigo.vivi, airlied

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

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-12-06  8:28 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-01  2:53 [Intel-gfx] [PATCH] drm/i915: use sysfs_emit() to instead of scnprintf() ye.xingchen
2022-12-01 17:00 ` [Intel-gfx] ✓ Fi.CI.BAT: success for " Patchwork
2022-12-02  5:39 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
2022-12-05 10:50 ` [Intel-gfx] [PATCH] " Jani Nikula
2022-12-06  4:26   ` Bagas Sanjaya

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox