OSDN Git Service

xtensa: shut up gcc-8 warnings
authorArnd Bergmann <arnd@arndb.de>
Tue, 2 Jan 2018 11:00:22 +0000 (12:00 +0100)
committerMax Filippov <jcmvbkbc@gmail.com>
Tue, 2 Jan 2018 11:25:41 +0000 (03:25 -0800)
commit32bb954dbf6db98562cb4477608dc546421caaf6
tree300f1602fa9492e0ef10a1ef03c023a0fd742614
parentfed566ca44ce99ff4604e3af941049f9a6bba405
xtensa: shut up gcc-8 warnings

Many uses of strncpy() on xtensa causes  a warning like

arch/xtensa/include/asm/string.h:56:42: warning: array subscript is above array bounds [-Warray-bounds]
   : "0" (__dest), "1" (__src), "r" (__src+__n)

This avoids the warning by turning the pointer arithmetic into an
integer operation that does not get checked the same way.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
arch/xtensa/include/asm/string.h