virtio-net: mark PM functions as __maybe_unused
authorArnd Bergmann <arnd@arndb.de>
Tue, 25 Jul 2017 15:35:50 +0000 (17:35 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 26 Jul 2017 04:22:45 +0000 (21:22 -0700)
commit67a75194bce07669bf11e14a24a95f64ebde8b47
treed34a52b2d747410acc2f79f566fb77907ab1e92e
parent34c8c10a766c8daf42293664f5c9ca5516fa3f41
virtio-net: mark PM functions as __maybe_unused

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: 4941d472bf95 ("virtio-net: do not reset during XDP set")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/virtio_net.c