summaryrefslogtreecommitdiff
path: root/drivers/leds/led-triggers.c
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2021-09-27 16:15:47 +0300
committerPavel Machek <pavel@ucw.cz>2021-09-27 17:09:42 +0300
commit811b5440c6e4998755990fd2c1455f42f3aae3b0 (patch)
tree63e6c8324857da74374f3a26a4a397a48fe52fa5 /drivers/leds/led-triggers.c
parent6880fa6c56601bb8ed59df6c30fd390cc5f6dd8f (diff)
downloadlinux-811b5440c6e4998755990fd2c1455f42f3aae3b0.tar.xz
led-class-flash: fix -Wrestrict warning
gcc-11 warns when building with W=1: drivers/leds/led-class-flash.c: In function 'flash_fault_show': drivers/leds/led-class-flash.c:210:16: error: 'sprintf' argument 3 overlaps destination object 'buf' [-Werror=restrict] 210 | return sprintf(buf, "%s\n", buf); | ^~~~~~~~~~~~~~~~~~~~~~~~~ drivers/leds/led-class-flash.c:187:54: note: destination object referenced by 'restrict'-qualified argument 1 was declared here 187 | struct device_attribute *attr, char *buf) | ~~~~~~^~~ There is no need for the sprintf() here when a strcat() does the same thing without invoking undefined behavior. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Pavel Machek <pavel@ucw.cz>
Diffstat (limited to 'drivers/leds/led-triggers.c')
0 files changed, 0 insertions, 0 deletions