Skip to content

Commit 9dedc91

Browse files
zhang songyidtor
authored andcommitted
Input: synaptics-rmi4 - convert to use sysfs_emit() APIs
Follow the advice of the Documentation/filesystems/sysfs.rst and show() should only use sysfs_emit() or sysfs_emit_at() when formatting the value to be returned to user space. Reported-by: Zeal Robot <zealci@zte.com.cn> Signed-off-by: zhang songyi <zhang.songyi@zte.com.cn> Link: https://lore.kernel.org/r/20220927070936.258300-1-zhang.songyi@zte.com.cn Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
1 parent 2b7672b commit 9dedc91

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

drivers/input/rmi4/rmi_f34.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -321,13 +321,13 @@ static ssize_t rmi_driver_bootloader_id_show(struct device *dev,
321321
f34 = dev_get_drvdata(&fn->dev);
322322

323323
if (f34->bl_version == 5)
324-
return scnprintf(buf, PAGE_SIZE, "%c%c\n",
325-
f34->bootloader_id[0],
326-
f34->bootloader_id[1]);
324+
return sysfs_emit(buf, "%c%c\n",
325+
f34->bootloader_id[0],
326+
f34->bootloader_id[1]);
327327
else
328-
return scnprintf(buf, PAGE_SIZE, "V%d.%d\n",
329-
f34->bootloader_id[1],
330-
f34->bootloader_id[0]);
328+
return sysfs_emit(buf, "V%d.%d\n",
329+
f34->bootloader_id[1],
330+
f34->bootloader_id[0]);
331331
}
332332

333333
return 0;
@@ -346,7 +346,7 @@ static ssize_t rmi_driver_configuration_id_show(struct device *dev,
346346
if (fn) {
347347
f34 = dev_get_drvdata(&fn->dev);
348348

349-
return scnprintf(buf, PAGE_SIZE, "%s\n", f34->configuration_id);
349+
return sysfs_emit(buf, "%s\n", f34->configuration_id);
350350
}
351351

352352
return 0;
@@ -499,7 +499,7 @@ static ssize_t rmi_driver_update_fw_status_show(struct device *dev,
499499
if (data->f34_container)
500500
update_status = rmi_f34_status(data->f34_container);
501501

502-
return scnprintf(buf, PAGE_SIZE, "%d\n", update_status);
502+
return sysfs_emit(buf, "%d\n", update_status);
503503
}
504504

505505
static DEVICE_ATTR(update_fw_status, 0444,

0 commit comments

Comments
 (0)