diff options
| author | Madhur Kumar <madhurkumar004@gmail.com> | 2025-12-14 14:06:59 +0530 |
|---|---|---|
| committer | Rodrigo Vivi <rodrigo.vivi@intel.com> | 2025-12-19 10:30:31 -0500 |
| commit | af90706f0eeca2ec78f73bdc164c5046bd8a9866 (patch) | |
| tree | 70f00ec4b64c39ae1a4e7c0285ff9566d60fea17 | |
| parent | 5add3c3c280a35f7e258e9cef7607db5a2e56fdc (diff) | |
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]
| -rw-r--r-- | drivers/gpu/drm/xe/xe_pmu.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/xe/xe_pmu.c b/drivers/gpu/drm/xe/xe_pmu.c index c63335eb69e5..0b20059dd7b3 100644 --- a/drivers/gpu/drm/xe/xe_pmu.c +++ b/drivers/gpu/drm/xe/xe_pmu.c @@ -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_) \ |
