1. 26 Jul, 2017 2 commits
    • Arnd Bergmann's avatar
      hamradio: dmascc: avoid -Wformat-overflow warning · 9877e105
      Arnd Bergmann authored
      gcc warns that the device name might overflow:
      
      drivers/net/hamradio/dmascc.c: In function 'dmascc_init':
      drivers/net/hamradio/dmascc.c:584:22: error: 'sprintf' may write a terminating nul past the end of the destination [-Werror=format-overflow=]
         sprintf(dev->name, "dmascc%i", 2 * n + i);
      drivers/net/hamradio/dmascc.c:584:3: note: 'sprintf' output between 8 and 17 bytes into a destination of size 16
         sprintf(dev->name, "dmascc%i", 2 * n + i);
      
      >From the static data in this file, I can tell that the index is
      strictly limited to 16, so it won't overflow. This simply changes
      the sprintf() to snprintf(), which is a good idea in general,
      and shuts up this warning.
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9877e105
    • Arnd Bergmann's avatar
      virtio-net: mark PM functions as __maybe_unused · 67a75194
      Arnd Bergmann authored
      After removing the reset function, the freeze and restore functions
      are now unused when CONFIG_PM_SLEEP is disabled:
      
      drivers/net/virtio_net.c:1881:12: error: 'virtnet_restore_up' defined but not used [-Werror=unused-function]
       static int virtnet_restore_up(struct virtio_device *vdev)
      drivers/net/virtio_net.c:1859:13: error: 'virtnet_freeze_down' defined but not used [-Werror=unused-function]
       static void virtnet_freeze_down(struct virtio_device *vdev)
      
      A more robust way to do this is to remove the #ifdef around the callers
      and instead mark them as __maybe_unused. The compiler will now just
      silently drop the unused code.
      
      Fixes: 4941d472 ("virtio-net: do not reset during XDP set")
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Acked-by: default avatarJason Wang <jasowang@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      67a75194
  2. 25 Jul, 2017 36 commits
  3. 24 Jul, 2017 2 commits