Skip to contentSkip to conversation

sound/pci/azt3328.c: adjust error handling code to include debugging code

PATCH In review Julia Lawall 3 participants 5 messages Aug 10, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sound/pci/azt3328.c: adjust error handling code to include debugging code

From: Julia Lawall <[email protected]>

snd_azf3328_dbgcallenter is called at the very beginning of the function, so it could be useful to call snd_azf3328_dbgcallleave at all exit points.

---
 sound/pci/azt3328.c |   11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
sound/pci/azt3328.c +7 -4
index e4d76a2..579fc0d 100644
@@ -2625,16 +2625,19 @@ snd_azf3328_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)
 	int err;
 
 	snd_azf3328_dbgcallenter();
-	if (dev >= SNDRV_CARDS)
-		return -ENODEV;
+	if (dev >= SNDRV_CARDS) {
+		err = -ENODEV;
+		goto out;
+	}
 	if (!enable[dev]) {
 		dev++;
-		return -ENOENT;
+		err = -ENOENT;
+		goto out;
 	}
 
 	err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card);
 	if (err < 0)
-		return err;
+		goto out;
 
 	strcpy(card->driver, "AZF3328");
 	strcpy(card->shortname, "Aztech AZF3328 (PCI168)");
#1 lore raw

At Wed, 10 Aug 2011 11:49:04 +0200,

Quoted 7 lines · Julia Lawall

From: Julia Lawall <[email protected]>

snd_azf3328_dbgcallenter is called at the very beginning of the function, so it could be useful to call snd_azf3328_dbgcallleave at all exit points.

Applied now to sound git tree. Thanks.

Takashi

Quoted 33 lines
---
 sound/pci/azt3328.c |   11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
sound/pci/azt3328.c +7 -4
index e4d76a2..579fc0d 100644
@@ -2625,16 +2625,19 @@ snd_azf3328_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)
 	int err;
 
 	snd_azf3328_dbgcallenter();
-	if (dev >= SNDRV_CARDS)
-		return -ENODEV;
+	if (dev >= SNDRV_CARDS) {
+		err = -ENODEV;
+		goto out;
+	}
 	if (!enable[dev]) {
 		dev++;
-		return -ENOENT;
+		err = -ENOENT;
+		goto out;
 	}
 
 	err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card);
 	if (err < 0)
-		return err;
+		goto out;
 
 	strcpy(card->driver, "AZF3328");
 	strcpy(card->shortname, "Aztech AZF3328 (PCI168)");
Acked-by
#2 lore raw

Hi,

Quoted 11 lines · Takashi Iwai

At Wed, 10 Aug 2011 11:49:04 +0200,

Quoted 7 lines · Julia Lawall

From: Julia Lawall <[email protected]>

snd_azf3328_dbgcallenter is called at the very beginning of the function, so it could be useful to call snd_azf3328_dbgcallleave at all exit points.

Applied now to sound git tree. Thanks.

5 minutes, 4 seconds. Your responsiveness appears to be degrading. I've seen better ;)

JFTR:

Andreas Mohr

#3 lore raw

At Wed, 10 Aug 2011 13:15:42 +0200,

Quoted 12 lines · Andreas Mohr

Hi,

Quoted 8 lines · Takashi Iwai

At Wed, 10 Aug 2011 11:49:04 +0200,

Quoted 6 lines · Julia Lawall

From: Julia Lawall <[email protected]>

snd_azf3328_dbgcallenter is called at the very beginning of the function, so it could be useful to call snd_azf3328_dbgcallleave at all exit points.

Quoted 6 lines
Quoted 3 lines
Quoted 1 line

Applied now to sound git tree. Thanks.

5 minutes, 4 seconds. Your responsiveness appears to be degrading. I've seen better ;)

Oh, could you bisect a regression? ;)

Takashi

#4 lore raw

Hi,

Quoted 6 lines · Takashi Iwai

At Wed, 10 Aug 2011 13:15:42 +0200,

Quoted 2 lines · Andreas Mohr

5 minutes, 4 seconds. Your responsiveness appears to be degrading. I've seen better ;)

Oh, could you bisect a regression? ;)

I'd probably have to consult Gunther von Hagens :-P

Andreas Mohr