[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAK8P3a1-w-hd5OSyhP=Ja5nxrtRDjus-MkazbcWqaiv3q4vLjw@mail.gmail.com>
Date: Mon, 27 Sep 2021 15:12:29 +0200
From: Arnd Bergmann <arnd@...nel.org>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: Pavel Machek <pavel@....cz>,
Andreas Noever <andreas.noever@...il.com>,
Michael Jamet <michael.jamet@...el.com>,
Mika Westerberg <mika.westerberg@...ux.intel.com>,
Yehezkel Bernat <YehezkelShB@...il.com>,
Arnd Bergmann <arnd@...db.de>,
Isaac Hazan <isaac.hazan@...el.com>,
Lee Jones <lee.jones@...aro.org>,
Rikard Falkeborn <rikard.falkeborn@...il.com>,
linux-leds@...r.kernel.org,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
USB list <linux-usb@...r.kernel.org>
Subject: Re: [PATCH] led-class-flash: fix -Wrestrict warning
On Mon, Sep 27, 2021 at 12:22 PM Greg Kroah-Hartman
<gregkh@...uxfoundation.org> wrote:
>
> On Mon, Sep 27, 2021 at 12:15:59PM +0200, Arnd Bergmann wrote:
> > From: Arnd Bergmann <arnd@...db.de>
> >
> > 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)
> > | ~~~~~~^~~
> > cc1: all warnings being treated as errors
> > make[5]: *** [scripts/Makefile.build:277: drivers/leds/led-class-flash.o] Error 1
> > make[5]: Target '__build' not remade because of errors.
> > make[4]: *** [scripts/Makefile.build:540: drivers/leds] Error 2
> > 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)
> >
>
> You also have a thunderbolt change in here as well :(
Oh, and I forgot to explain the change, clearly this one was meant to go
into the 'rework, then send' pile of my fixes.
v2 coming in a bit.
Arnd
Powered by blists - more mailing lists