[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y9Q5Tt8c9WBDxeyV@ubun2204.myguest.virtualbox.org>
Date: Sat, 28 Jan 2023 02:21:26 +0530
From: Deepak R Varma <drv@...lo.com>
To: Liviu Dudau <liviu.dudau@....com>,
Brian Starkey <brian.starkey@....com>,
David Airlie <airlied@...il.com>,
Daniel Vetter <daniel@...ll.ch>,
dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org
Cc: Saurabh Singh Sengar <ssengar@...rosoft.com>,
Praveen Kumar <kumarpraveen@...ux.microsoft.com>,
Deepak R Varma <drv@...lo.com>
Subject: [PATCH] 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@...lo.com>
---
drivers/gpu/drm/arm/malidp_drv.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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);
--
2.34.1
Powered by blists - more mailing lists