All of lore.kernel.org
 help / color / mirror / Atom feed
* [CI] drm/i915: i915_pmu: Use sysfs_emit() instead of sprintf()
@ 2025-09-24 20:41 Andi Shyti
  2025-09-24 23:27 ` ✓ i915.CI.BAT: success for drm/i915: i915_pmu: Use sysfs_emit() instead of sprintf() (rev3) Patchwork
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Andi Shyti @ 2025-09-24 20:41 UTC (permalink / raw)
  To: intel-gfx; +Cc: Andi Shyti, Madhur Kumar, Andi Shyti

From: Madhur Kumar <madhurkumar004@gmail.com>

Follow the advice in Documentation/filesystems/sysfs.rst:
show() should only use sysfs_emit() or sysfs_emit_at() when formatting
the value to be returned to user space.

Signed-off-by: Madhur Kumar <madhurkumar004@gmail.com>
Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com>
Signed-off-by: Andi Shyti <andi.shyti@linux.intel.com>
Link: https://lore.kernel.org/r/20250923195051.1277855-1-madhurkumar004@gmail.com
---
Hi,

I'm resending this patch because unfortunately CI doesn't test
patches from non allowed users. Although trivial, we need all the
patches to be tested.

Thanks Madhur,
Andi

 drivers/gpu/drm/i915/i915_pmu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_pmu.c b/drivers/gpu/drm/i915/i915_pmu.c
index 5bc696bfbb0f..d8f69bba79a9 100644
--- a/drivers/gpu/drm/i915/i915_pmu.c
+++ b/drivers/gpu/drm/i915/i915_pmu.c
@@ -895,7 +895,7 @@ static ssize_t i915_pmu_format_show(struct device *dev,
 	struct i915_str_attribute *eattr;
 
 	eattr = container_of(attr, struct i915_str_attribute, attr);
-	return sprintf(buf, "%s\n", eattr->str);
+	return sysfs_emit(buf, "%s\n", eattr->str);
 }
 
 #define I915_PMU_FORMAT_ATTR(_name, _config) \
@@ -925,7 +925,7 @@ static ssize_t i915_pmu_event_show(struct device *dev,
 	struct i915_ext_attribute *eattr;
 
 	eattr = container_of(attr, struct i915_ext_attribute, attr);
-	return sprintf(buf, "config=0x%lx\n", eattr->val);
+	return sysfs_emit(buf, "config=0x%lx\n", eattr->val);
 }
 
 #define __event(__counter, __name, __unit) \
-- 
2.51.0


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

end of thread, other threads:[~2025-09-25 22:36 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-24 20:41 [CI] drm/i915: i915_pmu: Use sysfs_emit() instead of sprintf() Andi Shyti
2025-09-24 23:27 ` ✓ i915.CI.BAT: success for drm/i915: i915_pmu: Use sysfs_emit() instead of sprintf() (rev3) Patchwork
2025-09-25  5:40 ` ✗ i915.CI.Full: failure " Patchwork
2025-09-25 11:09 ` ✓ i915.CI.BAT: success for drm/i915: i915_pmu: Use sysfs_emit() instead of sprintf() (rev4) Patchwork
2025-09-25 14:59 ` ✓ i915.CI.Full: " Patchwork
2025-09-25 21:07 ` [CI] drm/i915: i915_pmu: Use sysfs_emit() instead of sprintf() Ville Syrjälä
2025-09-25 22:36   ` Andi Shyti

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.