RE: [PATCH] hv: vmbus: mark PM functions as __maybe_unused

From: Dexuan Cui
Date: Thu Sep 19 2019 - 01:15:10 EST


> From: Arnd Bergmann <arnd@xxxxxxxx>
> Sent: Wednesday, September 18, 2019 1:01 PM
>
> When CONFIG_PM is disabled, we get a couple of harmless warnings:
>
> drivers/hv/vmbus_drv.c:918:12: error: unused function 'vmbus_suspend'
> [-Werror,-Wunused-function]
> drivers/hv/vmbus_drv.c:937:12: error: unused function 'vmbus_resume'
> [-Werror,-Wunused-function]
> drivers/hv/vmbus_drv.c:2128:12: error: unused function 'vmbus_bus_suspend'
> [-Werror,-Wunused-function]
> drivers/hv/vmbus_drv.c:2208:12: error: unused function 'vmbus_bus_resume'
> [-Werror,-Wunused-function]
>
> Mark these functions __maybe_unused to let gcc drop them silently.

Hi Arnd,
Thanks for reporting the issue!

If CONFIG_PM is not set, IMO it's better to comment out these functions. :-)

I'll post a patch for this with you Cc'd.

Thanks,
-- Dexuan