diff options
author | Deepak R Varma <drv@mailo.com> | 2023-01-28 02:21:26 +0530 |
---|---|---|
committer | Liviu Dudau <liviu.dudau@arm.com> | 2023-02-03 13:05:33 +0000 |
commit | 8094d717c7eb940830ff6f47a771c9be28bf43f0 (patch) | |
tree | b4351ede282a82e36cc4ec4bd4792627da91e968 /drivers/gpu/drm/arm/malidp_drv.c | |
parent | 4fae160fde76e9dc929ba57ec0efbbc1197daaf0 (diff) | |
download | linux-8094d717c7eb940830ff6f47a771c9be28bf43f0.tar.gz linux-8094d717c7eb940830ff6f47a771c9be28bf43f0.tar.bz2 linux-8094d717c7eb940830ff6f47a771c9be28bf43f0.zip |
drm/arm/malidp: use sysfs_emit in show function callback
According to Documentation/filesystems/sysfs.rst, the show() callback
function of kobject attributes should strictly use sysfs_emit() instead
of sprintf() family functions.
Issue identified using the device_attr_show.cocci Coccinelle script.
Signed-off-by: Deepak R Varma <drv@mailo.com>
Signed-off-by: Liviu Dudau <liviu.dudau@arm.com>
Link: https://patchwork.freedesktop.org/patch/msgid/Y9Q5Tt8c9WBDxeyV@ubun2204.myguest.virtualbox.org
Diffstat (limited to 'drivers/gpu/drm/arm/malidp_drv.c')
-rw-r--r-- | drivers/gpu/drm/arm/malidp_drv.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/arm/malidp_drv.c b/drivers/gpu/drm/arm/malidp_drv.c index 589c1c66a6dc..cf040e2e9efe 100644 --- a/drivers/gpu/drm/arm/malidp_drv.c +++ b/drivers/gpu/drm/arm/malidp_drv.c @@ -649,7 +649,7 @@ static ssize_t core_id_show(struct device *dev, struct device_attribute *attr, struct drm_device *drm = dev_get_drvdata(dev); struct malidp_drm *malidp = drm_to_malidp(drm); - return snprintf(buf, PAGE_SIZE, "%08x\n", malidp->core_id); + return sysfs_emit(buf, "%08x\n", malidp->core_id); } static DEVICE_ATTR_RO(core_id); |