staging: fbtft: convert sysfs snprintf to sysfs_emit
authorXuezhi Zhang <zhangxuezhi1@yulong.com>
Sat, 3 Apr 2021 14:07:22 +0000 (14:07 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 5 Apr 2021 10:15:15 +0000 (12:15 +0200)
Fix the following coccicheck warning:
drivers/staging/fbtft//fbtft-sysfs.c:202:8-16:
WARNING: use scnprintf or sprintf

Signed-off-by: Xuezhi Zhang <zhangxuezhi1@yulong.com>
Link: https://lore.kernel.org/r/20210403140722.169623-1-llyz108@163.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/fbtft/fbtft-sysfs.c

index 26e52cc..39e8d28 100644 (file)
@@ -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 =