From: Mika Westerberg <mika.westerberg@linux.intel.com>
To: Arnd Bergmann <arnd@kernel.org>
Cc: Andreas Noever <andreas.noever@gmail.com>,
Michael Jamet <michael.jamet@intel.com>,
Yehezkel Bernat <YehezkelShB@gmail.com>,
Arnd Bergmann <arnd@arndb.de>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Isaac Hazan <isaac.hazan@intel.com>,
Lee Jones <lee.jones@linaro.org>,
Rikard Falkeborn <rikard.falkeborn@gmail.com>,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] thunderbolt: fix -Wrestrict warning
Date: Tue, 28 Sep 2021 12:32:32 +0300 [thread overview]
Message-ID: <YVLhMNdk0TkURA89@lahna> (raw)
In-Reply-To: <20210927131620.1587294-1-arnd@kernel.org>
On Mon, Sep 27, 2021 at 03:16:11PM +0200, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> 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>
Applied, thanks!
prev parent reply other threads:[~2021-09-28 9:32 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-27 13:16 [PATCH] thunderbolt: fix -Wrestrict warning Arnd Bergmann
2021-09-28 9:32 ` Mika Westerberg [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YVLhMNdk0TkURA89@lahna \
--to=mika.westerberg@linux.intel.com \
--cc=YehezkelShB@gmail.com \
--cc=andreas.noever@gmail.com \
--cc=arnd@arndb.de \
--cc=arnd@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=isaac.hazan@intel.com \
--cc=lee.jones@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=michael.jamet@intel.com \
--cc=rikard.falkeborn@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.