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

Configure Feed

Select the types of activity you want to include in your feed.

powerpc/ps3: replace open-coded sysfs_emit function

sysfs_emit() helper function should be used when formatting the value
to be returned to user space.

This patch replaces open-coded sysfs_emit() in sysfs .show() callbacks

Link: https://github.com/KSPP/linux/issues/105
Signed-off-by: Paulo Miguel Almeida <paulo.miguel.almeida.rodenas@gmail.com>
Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Geoff Levand <geoff@infradead.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://patch.msgid.link/ZxMV3YvSulJFZ8rk@mail.google.com

authored by

Paulo Miguel Almeida and committed by
Michael Ellerman
2866949e d677ce52

+2 -3
+2 -3
arch/powerpc/platforms/ps3/system-bus.c
··· 453 453 char *buf) 454 454 { 455 455 struct ps3_system_bus_device *dev = ps3_dev_to_system_bus_dev(_dev); 456 - int len = snprintf(buf, PAGE_SIZE, "ps3:%d:%d\n", dev->match_id, 457 - dev->match_sub_id); 458 456 459 - return (len >= PAGE_SIZE) ? (PAGE_SIZE - 1) : len; 457 + return sysfs_emit(buf, "ps3:%d:%d\n", dev->match_id, 458 + dev->match_sub_id); 460 459 } 461 460 static DEVICE_ATTR_RO(modalias); 462 461