virtio_pci: pm: Use CONFIG_PM_SLEEP instead of CONFIG_PM
PATCH 1/1 virtio_pci: pm: Use CONFIG_PM_SLEEP instead of CONFIG_PM
The virtio_pci_freeze/restore are defined under CONFIG_PM but is used by SET_SYSTEM_SLEEP_PM_OPS macro, which is defined under CONFIG_PM_SLEEP. So if CONFIG_PM_SLEEP is not cofigured but CONFIG_PM_RUNTIME is, the following warning message appeared:
drivers/virtio/virtio_pci.c:770:12: warning: ‘virtio_pci_freeze’ defined but not used [-Wunused-function]
static int virtio_pci_freeze(struct device *dev)
^
drivers/virtio/virtio_pci.c:790:12: warning: ‘virtio_pci_restore’ defined but not used [-Wunused-function]
static int virtio_pci_restore(struct device *dev)
^Fix it by changing CONFIG_PM to CONFIG_PM_SLEEP.
--- drivers/virtio/virtio_pci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/virtio/virtio_pci.c +2 -2
@@ -766,7 +766,7 @@ static void virtio_pci_remove(struct pci_dev *pci_dev)kfree (vp_dev); } -#ifdef CONFIG_PM +#ifdef CONFIG_PM_SLEEP static int virtio_pci_freeze (struct device *dev) {struct pci_dev *pci_dev =to_pci_dev (dev);
@@ -824,7 +824,7 @@ static struct pci_driver virtio_pci_driver = { .id_table = virtio_pci_id_table, .probe = virtio_pci_probe, .remove = virtio_pci_remove, -#ifdef CONFIG_PM +#ifdef CONFIG_PM_SLEEP .driver.pm = &virtio_pci_pm_ops,#endif };
Signature · 1 line
1.8.3.2.10.g43d11f4
Quoted 12 lines · Aaron Lu
The virtio_pci_freeze/restore are defined under
CONFIG_PMbut is used bySET_SYSTEM_SLEEP_PM_OPSmacro, which is defined underCONFIG_PM_SLEEP. So ifCONFIG_PM_SLEEPis not cofigured butCONFIG_PM_RUNTIMEis, the following warning message appeared:
drivers/virtio/virtio_pci.c:770:12: warning: ‘virtio_pci_freeze’ defined but not used [-Wunused-function]
static intvirtio_pci_freeze(struct device *dev)^ drivers/virtio/virtio_pci.c:790:12: warning: ‘virtio_pci_restore’ defined but not used [-Wunused-function] static int virtio_pci_restore(struct device *dev) ^
Quoted 6 lines
Fix it by changing
CONFIG_PMtoCONFIG_PM_SLEEP.Signed-off-by Aaron Lu <[email protected]>--- drivers/virtio/virtio_pci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
While you're at it, can you update the virtio drivers as well?
drivers/block/virtio_blk.cdrivers/char/hw_random/virtio_rng.cdrivers/char/virtio_console.cdrivers/net/virtio_net.cdrivers/scsi/virtio_scsi.cdrivers/virtio/virtio_balloon.c
Thanks,
Amit
_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
Quoted 15 lines · Amit Shah
Quoted 14 lines · Aaron Lu
The virtio_pci_freeze/restore are defined under
CONFIG_PMbut is used bySET_SYSTEM_SLEEP_PM_OPSmacro, which is defined underCONFIG_PM_SLEEP. So ifCONFIG_PM_SLEEPis not cofigured butCONFIG_PM_RUNTIMEis, the following warning message appeared:
drivers/virtio/virtio_pci.c:770:12: warning: ‘virtio_pci_freeze’ defined but not used [-Wunused-function]
static intvirtio_pci_freeze(struct device *dev)^ drivers/virtio/virtio_pci.c:790:12: warning: ‘virtio_pci_restore’ defined but not used [-Wunused-function] static int virtio_pci_restore(struct device *dev) ^Fix it by changing
CONFIG_PMtoCONFIG_PM_SLEEP.
Quoted 6 lines
Quoted 4 lines
Signed-off-by Aaron Lu <[email protected]>--- drivers/virtio/virtio_pci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)While you're at it, can you update the virtio drivers as well?
No problem, I think I'll send a separate patch for them on top of this one, since they do not cause compile warnings.
Thanks,
Aaron
Quoted 12 lines
drivers/block/virtio_blk.cdrivers/char/hw_random/virtio_rng.cdrivers/char/virtio_console.cdrivers/net/virtio_net.cdrivers/scsi/virtio_scsi.cdrivers/virtio/virtio_balloon.cThanks,
Amit
Quoted 21 lines · Aaron Lu
Quoted 20 lines · Amit Shah
Quoted 18 lines · Aaron Lu
The virtio_pci_freeze/restore are defined under
CONFIG_PMbut is used bySET_SYSTEM_SLEEP_PM_OPSmacro, which is defined underCONFIG_PM_SLEEP. So ifCONFIG_PM_SLEEPis not cofigured butCONFIG_PM_RUNTIMEis, the following warning message appeared:
drivers/virtio/virtio_pci.c:770:12: warning: ‘virtio_pci_freeze’ defined but not used [-Wunused-function]
static intvirtio_pci_freeze(struct device *dev)^ drivers/virtio/virtio_pci.c:790:12: warning: ‘virtio_pci_restore’ defined but not used [-Wunused-function] static int virtio_pci_restore(struct device *dev) ^Fix it by changing
CONFIG_PMtoCONFIG_PM_SLEEP.Signed-off-by Aaron Lu <[email protected]>--- drivers/virtio/virtio_pci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Quoted 4 lines
Quoted 1 line
While you're at it, can you update the virtio drivers as well?
No problem, I think I'll send a separate patch for them on top of this one, since they do not cause compile warnings.
Yes, thanks.
Amit
_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
Quoted 15 lines · Amit Shah
Quoted 14 lines · Aaron Lu
The virtio_pci_freeze/restore are defined under
CONFIG_PMbut is used bySET_SYSTEM_SLEEP_PM_OPSmacro, which is defined underCONFIG_PM_SLEEP. So ifCONFIG_PM_SLEEPis not cofigured butCONFIG_PM_RUNTIMEis, the following warning message appeared:
drivers/virtio/virtio_pci.c:770:12: warning: ‘virtio_pci_freeze’ defined but not used [-Wunused-function]
static intvirtio_pci_freeze(struct device *dev)^ drivers/virtio/virtio_pci.c:790:12: warning: ‘virtio_pci_restore’ defined but not used [-Wunused-function] static int virtio_pci_restore(struct device *dev) ^Fix it by changing
CONFIG_PMtoCONFIG_PM_SLEEP.
Quoted 6 lines
Quoted 4 lines
Signed-off-by Aaron Lu <[email protected]>--- drivers/virtio/virtio_pci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)While you're at it, can you update the virtio drivers as well?
No problem, I think I'll send a separate patch for them on top of this one, since they do not cause compile warnings.
Thanks,
Aaron
Quoted 8 lines
drivers/block/virtio_blk.cdrivers/char/hw_random/virtio_rng.cdrivers/char/virtio_console.cdrivers/net/virtio_net.cdrivers/scsi/virtio_scsi.cdrivers/virtio/virtio_balloon.c
Quoted 4 lines
Thanks,
Amit
_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
Quoted 8 lines · Aaron Lu
The virtio_pci_freeze/restore are defined under
CONFIG_PMbut is used bySET_SYSTEM_SLEEP_PM_OPSmacro, which is defined underCONFIG_PM_SLEEP. So ifCONFIG_PM_SLEEPis not cofigured butCONFIG_PM_RUNTIMEis, the following warning message appeared:
drivers/virtio/virtio_pci.c:770:12: warning: ‘virtio_pci_freeze’ defined but not used [-Wunused-function]
static intvirtio_pci_freeze(struct device *dev)
Quoted 7 lines
^ drivers/virtio/virtio_pci.c:790:12: warning: ‘virtio_pci_restore’ defined but not used [-Wunused-function] static int virtio_pci_restore(struct device *dev) ^Fix it by changing
CONFIG_PMtoCONFIG_PM_SLEEP.Signed-off-by Aaron Lu <[email protected]>
Amit
_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
Rusty Russell
AppliedQuoted 15 lines · Amit Shah
Quoted 14 lines · Aaron Lu
The virtio_pci_freeze/restore are defined under
CONFIG_PMbut is used bySET_SYSTEM_SLEEP_PM_OPSmacro, which is defined underCONFIG_PM_SLEEP. So ifCONFIG_PM_SLEEPis not cofigured butCONFIG_PM_RUNTIMEis, the following warning message appeared:
drivers/virtio/virtio_pci.c:770:12: warning: ‘virtio_pci_freeze’ defined but not used [-Wunused-function]
static intvirtio_pci_freeze(struct device *dev)^ drivers/virtio/virtio_pci.c:790:12: warning: ‘virtio_pci_restore’ defined but not used [-Wunused-function] static int virtio_pci_restore(struct device *dev) ^Fix it by changing
CONFIG_PMtoCONFIG_PM_SLEEP.
Quoted 5 lines
Quoted 1 line
Signed-off-by Aaron Lu <[email protected]>Reviewed-by Amit Shah <[email protected]>Amit
Applied.
Thanks,
Rusty.
_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization