Skip to content

Commit af90706

Browse files
MadhurKumar004rodrigovivi
authored andcommitted
drm/xe/pmu: 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. Signed-off-by: Madhur Kumar <madhurkumar004@gmail.com> Link: https://patch.msgid.link/20251214083659.2412218-1-madhurkumar004@gmail.com Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com> [Rodrigo adjusted commit message while pushing it]
1 parent 5add3c3 commit af90706

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/gpu/drm/xe/xe_pmu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ static ssize_t event_attr_show(struct device *dev,
425425
struct perf_pmu_events_attr *pmu_attr =
426426
container_of(attr, struct perf_pmu_events_attr, attr);
427427

428-
return sprintf(buf, "event=%#04llx\n", pmu_attr->id);
428+
return sysfs_emit(buf, "event=%#04llx\n", pmu_attr->id);
429429
}
430430

431431
#define XE_EVENT_ATTR(name_, v_, id_) \

0 commit comments

Comments
 (0)