Forum | Documentation | Website | Blog

Skip to content
Snippets Groups Projects
  1. Oct 05, 2021
    • Arnd Bergmann's avatar
      Input: analog - fix invalid snprintf() call · 1f59342b
      Arnd Bergmann authored
      
      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.
      
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Link: https://lore.kernel.org/r/20210927101416.1569609-1-arnd@kernel.org
      
      
      Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
      1f59342b
  2. Oct 02, 2021
  3. Sep 23, 2021
  4. Sep 21, 2021
  5. Sep 10, 2021
  6. Sep 05, 2021
  7. Sep 04, 2021
  8. Aug 30, 2021
  9. Aug 29, 2021
  10. Jul 23, 2021
  11. Jul 21, 2021
  12. Jul 19, 2021