Re: [PATCH net-next] virtio-net: mark PM functions as __maybe_unused

From: David Miller
Date: Wed Jul 26 2017 - 00:23:26 EST


From: Arnd Bergmann <arnd@xxxxxxxx>
Date: Tue, 25 Jul 2017 17:35:50 +0200

> 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@xxxxxxxx>

Applied, thanks.