diff options
author | Dexuan Cui <decui@microsoft.com> | 2019-09-19 17:46:12 -0400 |
---|---|---|
committer | Sasha Levin <sashal@kernel.org> | 2019-10-01 14:49:45 -0400 |
commit | 83b50f83a96899f30c6369ef5988412fa2354ab2 (patch) | |
tree | d7828ca795b63c2e8f72260d58fc7b27681682da | |
parent | 6a297c90efa68b2864483193b8bfb0d19478600c (diff) |
Drivers: hv: vmbus: Fix harmless building warnings without CONFIG_PM_SLEEP
If CONFIG_PM_SLEEP is not set, we can comment out these functions to avoid
the below warnings:
drivers/hv/vmbus_drv.c:2208:12: warning: ‘vmbus_bus_resume’ defined but not used [-Wunused-function]
drivers/hv/vmbus_drv.c:2128:12: warning: ‘vmbus_bus_suspend’ defined but not used [-Wunused-function]
drivers/hv/vmbus_drv.c:937:12: warning: ‘vmbus_resume’ defined but not used [-Wunused-function]
drivers/hv/vmbus_drv.c:918:12: warning: ‘vmbus_suspend’ defined but not used [-Wunused-function]
Fixes: 271b2224d42f ("Drivers: hv: vmbus: Implement suspend/resume for VSC drivers for hibernation")
Fixes: f53335e3289f ("Drivers: hv: vmbus: Suspend/resume the vmbus itself for hibernation")
Reported-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Dexuan Cui <decui@microsoft.com>
Reviewed-by: Michael Kelley <mikelley@microsoft.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r-- | drivers/hv/vmbus_drv.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c index 391f0b225c9a..53a60c81e220 100644 --- a/drivers/hv/vmbus_drv.c +++ b/drivers/hv/vmbus_drv.c | |||
@@ -912,6 +912,7 @@ static void vmbus_shutdown(struct device *child_device) | |||
912 | drv->shutdown(dev); | 912 | drv->shutdown(dev); |
913 | } | 913 | } |
914 | 914 | ||
915 | #ifdef CONFIG_PM_SLEEP | ||
915 | /* | 916 | /* |
916 | * vmbus_suspend - Suspend a vmbus device | 917 | * vmbus_suspend - Suspend a vmbus device |
917 | */ | 918 | */ |
@@ -949,6 +950,7 @@ static int vmbus_resume(struct device *child_device) | |||
949 | 950 | ||
950 | return drv->resume(dev); | 951 | return drv->resume(dev); |
951 | } | 952 | } |
953 | #endif /* CONFIG_PM_SLEEP */ | ||
952 | 954 | ||
953 | /* | 955 | /* |
954 | * vmbus_device_release - Final callback release of the vmbus child device | 956 | * vmbus_device_release - Final callback release of the vmbus child device |
@@ -1070,6 +1072,7 @@ msg_handled: | |||
1070 | vmbus_signal_eom(msg, message_type); | 1072 | vmbus_signal_eom(msg, message_type); |
1071 | } | 1073 | } |
1072 | 1074 | ||
1075 | #ifdef CONFIG_PM_SLEEP | ||
1073 | /* | 1076 | /* |
1074 | * Fake RESCIND_CHANNEL messages to clean up hv_sock channels by force for | 1077 | * Fake RESCIND_CHANNEL messages to clean up hv_sock channels by force for |
1075 | * hibernation, because hv_sock connections can not persist across hibernation. | 1078 | * hibernation, because hv_sock connections can not persist across hibernation. |
@@ -1105,6 +1108,7 @@ static void vmbus_force_channel_rescinded(struct vmbus_channel *channel) | |||
1105 | vmbus_connection.work_queue, | 1108 | vmbus_connection.work_queue, |
1106 | &ctx->work); | 1109 | &ctx->work); |
1107 | } | 1110 | } |
1111 | #endif /* CONFIG_PM_SLEEP */ | ||
1108 | 1112 | ||
1109 | /* | 1113 | /* |
1110 | * Direct callback for channels using other deferred processing | 1114 | * Direct callback for channels using other deferred processing |
@@ -2125,6 +2129,7 @@ acpi_walk_err: | |||
2125 | return ret_val; | 2129 | return ret_val; |
2126 | } | 2130 | } |
2127 | 2131 | ||
2132 | #ifdef CONFIG_PM_SLEEP | ||
2128 | static int vmbus_bus_suspend(struct device *dev) | 2133 | static int vmbus_bus_suspend(struct device *dev) |
2129 | { | 2134 | { |
2130 | struct vmbus_channel *channel, *sc; | 2135 | struct vmbus_channel *channel, *sc; |
@@ -2247,6 +2252,7 @@ static int vmbus_bus_resume(struct device *dev) | |||
2247 | 2252 | ||
2248 | return 0; | 2253 | return 0; |
2249 | } | 2254 | } |
2255 | #endif /* CONFIG_PM_SLEEP */ | ||
2250 | 2256 | ||
2251 | static const struct acpi_device_id vmbus_acpi_device_ids[] = { | 2257 | static const struct acpi_device_id vmbus_acpi_device_ids[] = { |
2252 | {"VMBUS", 0}, | 2258 | {"VMBUS", 0}, |