Skip to content

hid: replace snprintf in show functions with sysfs_emit

Qing Wang linux-iio linux-input lkml 2 versions In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest5 patches 2 repliesIn review
  2. v11 patch 3 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5hid-lenovo: replace snprintf in show functions with sysfs_emitdrivers/hid/hid-lenovo.c+8 -81 reply
2/5hid-picolcd: replace snprintf in show functions with sysfs_emitdrivers/hid/hid-picolcd_core.c+3 -30 replies
3/5hid-roccat: replace snprintf in show functions with sysfs_emitdrivers/hid/hid-roccat-isku.c drivers/hid/hid-roccat-kone.c drivers/hid/hid-roccat-koneplus.c +2 more+17 -170 replies
4/5hid-sensor: replace snprintf in show functions with sysfs_emitdrivers/hid/hid-sensor-custom.c+1 -11 reply
5/5hid-sony: replace snprintf in show functions with sysfs_emitdrivers/hid/hid-sony.c+3 -30 replies

Reviews trailers per patch

1 of 5 patches has a Reviewed-by or Acked-by.

PatchBruno Prémont
1/5
2/5A-b
3/5
4/5
5/5

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH V2 0/5] hid: replace snprintf in show functions with sysfs_emit

According to Documentation/filesystems/sysfs.txt:
show() methods of device attributes should return the number of bytes printed into the buffer. This is the return value of scnprintf(). snprintf() returns the length the resulting string.

So, show() should not use snprintf() when formatting the value to be returned to user space. Also, use sysfs_emit directly makes more sense.

Qing Wang (5):
hid-lenovo: replace snprintf in show functions with sysfs_emit
hid-picolcd: replace snprintf in show functions with sysfs_emit
hid-roccat: replace snprintf in show functions with sysfs_emit
hid-sensor: replace snprintf in show functions with sysfs_emit
hid-sony: replace snprintf in show functions with sysfs_emit

 drivers/hid/hid-lenovo.c          | 16 ++++++++--------
 drivers/hid/hid-picolcd_core.c    |  6 +++---
 drivers/hid/hid-roccat-isku.c     |  2 +-
 drivers/hid/hid-roccat-kone.c     | 12 ++++++------
 drivers/hid/hid-roccat-koneplus.c |  4 ++--
 drivers/hid/hid-roccat-kovaplus.c | 10 +++++-----
 drivers/hid/hid-roccat-pyra.c     |  6 +++---
 drivers/hid/hid-sensor-custom.c   |  2 +-
 drivers/hid/hid-sony.c            |  6 +++---
 9 files changed, 32 insertions(+), 32 deletions(-)
Signature · 1 line
2.7.4