Messages in this thread | | | Date | Tue, 5 Oct 2021 13:28:10 -0700 | From | Dmitry Torokhov <> | Subject | Re: [PATCH] [RESEND] [v2] Input: analog - fix invalid snprintf() call |
| |
On Mon, Sep 27, 2021 at 12:14:06PM +0200, Arnd Bergmann wrote: > From: Arnd Bergmann <arnd@arndb.de> > > Overlapping input and output arguments to snprintf() are > undefined behavior in C99: > > drivers/input/joystick/analog.c: In function 'analog_name': > drivers/input/joystick/analog.c:428:3: error: 'snprintf' argument 4 overlaps destination object 'analog' [-Werror=restrict] > 428 | snprintf(analog->name, sizeof(analog->name), "%s %d-hat", > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > 429 | analog->name, hweight16(analog->mask & ANALOG_HATS_ALL)); > | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > drivers/input/joystick/analog.c:420:40: note: destination object referenced by 'restrict'-qualified argument 1 was declared here > 420 | static void analog_name(struct analog *analog) > | ~~~~~~~~~~~~~~~^~~~~~ > > Change this function to use the simpler seq_buf interface instead. > > Cc: Rasmus Villemoes <rasmus.villemoes@prevas.dk> > Link: https://lore.kernel.org/all/20210323131456.2600132-1-arnd@kernel.org/ > Link: https://lore.kernel.org/all/20210324131959.2089129-1-arnd@kernel.org/ > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Applied, thank you.
-- Dmitry
| |