Skip to content

Commit

Permalink
Drivers: hv: vmbus: Fix harmless building warnings without CONFIG_PM_…
Browse files Browse the repository at this point in the history
…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: 271b222 ("Drivers: hv: vmbus: Implement suspend/resume for VSC drivers for hibernation")
Fixes: f53335e ("Drivers: hv: vmbus: Suspend/resume the vmbus itself for hibernation")
Reported-by: Arnd Bergmann <[email protected]>
Signed-off-by: Dexuan Cui <[email protected]>
Reviewed-by:  Michael Kelley <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
  • Loading branch information
dcui authored and Sasha Levin committed Oct 1, 2019
1 parent 6a297c9 commit 83b50f8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/hv/vmbus_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -912,6 +912,7 @@ static void vmbus_shutdown(struct device *child_device)
drv->shutdown(dev);
}

#ifdef CONFIG_PM_SLEEP
/*
* vmbus_suspend - Suspend a vmbus device
*/
Expand Down Expand Up @@ -949,6 +950,7 @@ static int vmbus_resume(struct device *child_device)

return drv->resume(dev);
}
#endif /* CONFIG_PM_SLEEP */

/*
* vmbus_device_release - Final callback release of the vmbus child device
Expand Down Expand Up @@ -1070,6 +1072,7 @@ void vmbus_on_msg_dpc(unsigned long data)
vmbus_signal_eom(msg, message_type);
}

#ifdef CONFIG_PM_SLEEP
/*
* Fake RESCIND_CHANNEL messages to clean up hv_sock channels by force for
* hibernation, because hv_sock connections can not persist across hibernation.
Expand Down Expand Up @@ -1105,6 +1108,7 @@ static void vmbus_force_channel_rescinded(struct vmbus_channel *channel)
vmbus_connection.work_queue,
&ctx->work);
}
#endif /* CONFIG_PM_SLEEP */

/*
* Direct callback for channels using other deferred processing
Expand Down Expand Up @@ -2125,6 +2129,7 @@ static int vmbus_acpi_add(struct acpi_device *device)
return ret_val;
}

#ifdef CONFIG_PM_SLEEP
static int vmbus_bus_suspend(struct device *dev)
{
struct vmbus_channel *channel, *sc;
Expand Down Expand Up @@ -2247,6 +2252,7 @@ static int vmbus_bus_resume(struct device *dev)

return 0;
}
#endif /* CONFIG_PM_SLEEP */

static const struct acpi_device_id vmbus_acpi_device_ids[] = {
{"VMBUS", 0},
Expand Down

0 comments on commit 83b50f8

Please sign in to comment.