Skip to content
Commit 0a0624a2 authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Mika Westerberg
Browse files

thunderbolt: Fix -Wrestrict warning



gcc-11 warns when building with W=1:

drivers/thunderbolt/xdomain.c: In function 'modalias_show':
drivers/thunderbolt/xdomain.c:733:16: error: 'sprintf' argument 3 overlaps destination object 'buf' [-Werror=restrict]
  733 |         return sprintf(buf, "%s\n", buf);
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~
drivers/thunderbolt/xdomain.c:727:36: note: destination object referenced by 'restrict'-qualified argument 1 was declared here
  727 |                              char *buf)
      |                              ~~~~~~^~~

There is no need for the sprintf() here when a strcat() does
the same thing.

Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Signed-off-by: default avatarMika Westerberg <mika.westerberg@linux.intel.com>
parent 641cdbea
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment