[alsa-devel] [PATCH 0/3] use named constants for pci_power_t values
Replace numbers by named constants. The complete semantic patch used is as follows (http://coccinelle.lip6.fr/):
// <smpl> @@ expression pdev; @@
pci_set_power_state(pdev, ( - 0 + PCI_D0 | - 1 + PCI_D1 | - 2 + PCI_D2 | - 3 + PCI_D3hot | - 4 + PCI_D3cold | - 5 + PCI_UNKNOWN | - -1 + PCI_POWER_ERROR ) )
@@ expression e1,e2; @@
pci_enable_wake(e1, ( - 0 + PCI_D0 | - 1 + PCI_D1 | - 2 + PCI_D2 | - 3 + PCI_D3hot | - 4 + PCI_D3cold | - 5 + PCI_UNKNOWN | - -1 + PCI_POWER_ERROR ) ,e2) // </smpl>
From: Julia Lawall Julia.Lawall@lip6.fr
The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/)
// <smpl> @@ expression pdev; @@
pci_set_power_state(pdev, - 3 + PCI_D3hot ) // </smpl>
Signed-off-by: Julia Lawall Julia.Lawall@lip6.fr
--- sound/pci/cs5535audio/cs5535audio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/pci/cs5535audio/cs5535audio.c b/sound/pci/cs5535audio/cs5535audio.c index 902bebd..c0d2835 100644 --- a/sound/pci/cs5535audio/cs5535audio.c +++ b/sound/pci/cs5535audio/cs5535audio.c @@ -253,7 +253,7 @@ static irqreturn_t snd_cs5535audio_interrupt(int irq, void *dev_id) static int snd_cs5535audio_free(struct cs5535audio *cs5535au) { synchronize_irq(cs5535au->irq); - pci_set_power_state(cs5535au->pci, 3); + pci_set_power_state(cs5535au->pci, PCI_D3hot);
if (cs5535au->irq >= 0) free_irq(cs5535au->irq, cs5535au);
At Fri, 3 Jan 2014 00:40:30 +0100, Julia Lawall wrote:
From: Julia Lawall Julia.Lawall@lip6.fr
The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/)
// <smpl> @@ expression pdev; @@
pci_set_power_state(pdev,
- 3
- PCI_D3hot
) // </smpl>
Signed-off-by: Julia Lawall Julia.Lawall@lip6.fr
Thanks, applied.
Takashi
sound/pci/cs5535audio/cs5535audio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/pci/cs5535audio/cs5535audio.c b/sound/pci/cs5535audio/cs5535audio.c index 902bebd..c0d2835 100644 --- a/sound/pci/cs5535audio/cs5535audio.c +++ b/sound/pci/cs5535audio/cs5535audio.c @@ -253,7 +253,7 @@ static irqreturn_t snd_cs5535audio_interrupt(int irq, void *dev_id) static int snd_cs5535audio_free(struct cs5535audio *cs5535au) { synchronize_irq(cs5535au->irq);
- pci_set_power_state(cs5535au->pci, 3);
pci_set_power_state(cs5535au->pci, PCI_D3hot);
if (cs5535au->irq >= 0) free_irq(cs5535au->irq, cs5535au);
participants (2)
-
Julia Lawall
-
Takashi Iwai