Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

authored by

Deepak R Varma and committed by
Liviu Dudau
8094d717 4fae160f

+1 -1
+1 -1
drivers/gpu/drm/arm/malidp_drv.c
··· 649 649 struct drm_device *drm = dev_get_drvdata(dev); 650 650 struct malidp_drm *malidp = drm_to_malidp(drm); 651 651 652 - return snprintf(buf, PAGE_SIZE, "%08x\n", malidp->core_id); 652 + return sysfs_emit(buf, "%08x\n", malidp->core_id); 653 653 } 654 654 655 655 static DEVICE_ATTR_RO(core_id);