Skip to contentSkip to conversation

drm: xe: Replace sprintf() with sysfs_emit()

PATCH RESEND In review Madhur Kumar 3 participants 3 messages Dec 14, 2025 – Dec 19, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 drm: xe: Replace sprintf() with sysfs_emit()

Replace sprintf() calls with sysfs_emit() to follow current kernel coding standards.

sysfs_emit() is the preferred method for formatting sysfs output as it provides better bounds checking and is more secure.

---
 drivers/gpu/drm/xe/xe_pmu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/xe/xe_pmu.c +1 -1
index cab51d826345..f016459c9904 100644
@@ -425,7 +425,7 @@ static ssize_t event_attr_show(struct device *dev,
 	struct perf_pmu_events_attr *pmu_attr =
 		container_of(attr, struct perf_pmu_events_attr, attr);
 
-	return sprintf(buf, "event=%#04llx\n", pmu_attr->id);
+	return sysfs_emit(buf, "event=%#04llx\n", pmu_attr->id);
 }
 
 #define XE_EVENT_ATTR(name_, v_, id_)					\
Signature · 1 line
2.52.0
#1 lore raw

✗ LGCI.VerificationFailed: failure for drm: xe: Replace sprintf() with sysfs_emit() (rev2)

== Series Details ==

== Series Details ==

Series: drm: xe: Replace sprintf() with sysfs_emit() (rev2)
URL : https://patchwork.freedesktop.org/series/158644/
State : failure

== Summary ==

Address '[email protected]' is not on the allowlist, which prevents CI from being triggered for this patch. If you want Intel GFX CI to accept this address, please contact the script maintainers at [email protected]. Exception occurred during validation, bailing out!

maintainer
#2 lore raw
In reply to Madhur Kumar
Quoted 7 lines · Madhur Kumar

Replace sprintf() calls with sysfs_emit() to follow current kernel coding standards.

sysfs_emit() is the preferred method for formatting sysfs output as it provides better bounds checking and is more secure.

Thanks for the patch.
I just did a small adjustment in the patch subject while getting it pushed to drm-xe-next.

[drm-xe-next af90706f0eec] drm/xe/pmu: Replace sprintf() with sysfs_emit()

Quoted 20 lines
---
 drivers/gpu/drm/xe/xe_pmu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/xe/xe_pmu.c +1 -1
index cab51d826345..f016459c9904 100644
@@ -425,7 +425,7 @@ static ssize_t event_attr_show(struct device *dev,
 	struct perf_pmu_events_attr *pmu_attr =
 		container_of(attr, struct perf_pmu_events_attr, attr);
 
-	return sprintf(buf, "event=%#04llx\n", pmu_attr->id);
+	return sysfs_emit(buf, "event=%#04llx\n", pmu_attr->id);
 }
 
 #define XE_EVENT_ATTR(name_, v_, id_)					\
Signature · 1 line
2.52.0