Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

HID: displays: convert sysfs sprintf/snprintf family to sysfs_emit

Fix the following coccicheck warning:

./drivers/hid/hid-roccat-arvo.c:45:8-16: WARNING: use scnprintf or
sprintf.

./drivers/hid/hid-roccat-arvo.c:95:8-16: WARNING: use scnprintf or
sprintf.

./drivers/hid/hid-roccat-arvo.c:149:8-16: WARNING: use scnprintf or
sprintf.

Reported-by: Abaci Robot<abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>

authored by

Jiapeng Chong and committed by
Jiri Kosina
2fad0abd d8833124

+3 -3
+3 -3
drivers/hid/hid-roccat-arvo.c
··· 42 42 if (retval) 43 43 return retval; 44 44 45 - return snprintf(buf, PAGE_SIZE, "%d\n", temp_buf.state); 45 + return sysfs_emit(buf, "%d\n", temp_buf.state); 46 46 } 47 47 48 48 static ssize_t arvo_sysfs_set_mode_key(struct device *dev, ··· 92 92 if (retval) 93 93 return retval; 94 94 95 - return snprintf(buf, PAGE_SIZE, "%d\n", temp_buf.key_mask); 95 + return sysfs_emit(buf, "%d\n", temp_buf.key_mask); 96 96 } 97 97 98 98 static ssize_t arvo_sysfs_set_key_mask(struct device *dev, ··· 146 146 struct arvo_device *arvo = 147 147 hid_get_drvdata(dev_get_drvdata(dev->parent->parent)); 148 148 149 - return snprintf(buf, PAGE_SIZE, "%d\n", arvo->actual_profile); 149 + return sysfs_emit(buf, "%d\n", arvo->actual_profile); 150 150 } 151 151 152 152 static ssize_t arvo_sysfs_set_actual_profile(struct device *dev,