thunderbolt: Fix -Wrestrict warning
authorArnd Bergmann <arnd@arndb.de>
Mon, 27 Sep 2021 13:16:11 +0000 (15:16 +0200)
committerMika Westerberg <mika.westerberg@linux.intel.com>
Tue, 28 Sep 2021 09:28:54 +0000 (12:28 +0300)
commit0a0624a26f9ceb8aae16882d87dc3b12f17f4a49
tree7e56bd65e4a8ad3a2c2b35f78defd7e94dc8ba9c
parent641cdbea7635be3a177dbdf81356ccb16f3769e3
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: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
drivers/thunderbolt/xdomain.c