Skip to contentSkip to conversation

virtio_pci: pm: Use CONFIG_PM_SLEEP instead of CONFIG_PM

PATCH Applied Aaron Lu 3 participants 7 messages Sep 6, 2013 – Sep 9, 2013 virtio core

lore
Share & tools
lore

Aaron Lu

author
#0 lore raw

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
index 1aba255..98917fc 100644
@@ -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
#1 lore raw
Quoted 12 lines · Aaron Lu

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)
            ^
Quoted 6 lines

Fix it by changing CONFIG_PM to CONFIG_PM_SLEEP.

---
 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.c
drivers/char/hw_random/virtio_rng.c
drivers/char/virtio_console.c
drivers/net/virtio_net.c
drivers/scsi/virtio_scsi.c
drivers/virtio/virtio_balloon.c

Thanks,

Amit
_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

author
#2 lore raw
Quoted 15 lines · Amit Shah
Quoted 14 lines · Aaron Lu

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.

Quoted 6 lines
Quoted 4 lines
---
 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.c
drivers/char/hw_random/virtio_rng.c
drivers/char/virtio_console.c
drivers/net/virtio_net.c
drivers/scsi/virtio_scsi.c
drivers/virtio/virtio_balloon.c

Thanks,

Amit

#3 lore raw
Quoted 21 lines · Aaron Lu
Quoted 20 lines · Amit Shah
Quoted 18 lines · Aaron Lu

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(-)
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

author
#4 lore raw
In reply to Amit Shah
Quoted 15 lines · Amit Shah
Quoted 14 lines · Aaron Lu

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.

Quoted 6 lines
Quoted 4 lines
---
 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.c
drivers/char/hw_random/virtio_rng.c
drivers/char/virtio_console.c
drivers/net/virtio_net.c
drivers/scsi/virtio_scsi.c
drivers/virtio/virtio_balloon.c

Quoted 4 lines

Thanks,

Amit

_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Reviewed-by on v1 1/1
#5 lore raw
In reply to Aaron Lu
Quoted 8 lines · Aaron Lu

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)

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_PM to CONFIG_PM_SLEEP.

Amit
_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

#6 lore raw
Quoted 15 lines · Amit Shah
Quoted 14 lines · Aaron Lu

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.

Quoted 5 lines
Quoted 1 line

Amit

Applied.

Thanks,
Rusty.
_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization