* [PATCH] staging: fbtft: Use sysfs_emit for show(device *...) functions
@ 2020-10-18 18:41 Deepak R Varma
0 siblings, 0 replies; only message in thread
From: Deepak R Varma @ 2020-10-18 18:41 UTC (permalink / raw)
To: outreachy-kernel, Greg Kroah-Hartman; +Cc: mh12gx2825
Convert snprintf calls in device show functions to sysfs_emit for
PAGE_SIZE buffer safety.
Warning generated by: scripts/coccinelle/api/device_attr_show.cocci
Signed-off-by: Deepak R Varma <mh12gx2825@gmail.com>
---
drivers/staging/fbtft/fbtft-sysfs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/fbtft/fbtft-sysfs.c b/drivers/staging/fbtft/fbtft-sysfs.c
index 26e52cc2de64..39e8d28066cb 100644
--- a/drivers/staging/fbtft/fbtft-sysfs.c
+++ b/drivers/staging/fbtft/fbtft-sysfs.c
@@ -199,7 +199,7 @@ static ssize_t show_debug(struct device *device,
struct fb_info *fb_info = dev_get_drvdata(device);
struct fbtft_par *par = fb_info->par;
- return snprintf(buf, PAGE_SIZE, "%lu\n", par->debug);
+ return sysfs_emit(buf, "%lu\n", par->debug);
}
static struct device_attribute debug_device_attr =
--
2.25.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2020-10-18 18:41 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-10-18 18:41 [PATCH] staging: fbtft: Use sysfs_emit for show(device *...) functions Deepak R Varma
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.