[alsa-devel] sound/pci/au88x0/au88x0_core.c:2464 vortex_interrupt() warn: if();

Takashi Iwai tiwai at suse.de
Tue Oct 23 16:35:53 CEST 2012


At Tue, 23 Oct 2012 22:16:42 +0800,
Fengguang Wu wrote:
> 
> Hi,
> 
> smatch warns about a weird "if();" in sound/pci/au88x0/au88x0_core.c 
> Any ideas to fix it?
> 
>         2461 #ifndef CHIP_AU8810
>         2462                 for (i = 0; i < NR_WT; i++) {
>         2463                         if (vortex->dma_wt[i].fifo_status == FIFO_START) {
> ==>     2464                                 if (vortex_wtdma_bufshift(vortex, i)) ;
>         2465                                 spin_unlock(&vortex->lock);
>         2466                                 snd_pcm_period_elapsed(vortex->dma_wt[i].
>         2467                                                        substream);
>         2468                                 spin_lock(&vortex->lock);
>         2469                         }
>         2470                 }
>         2471 #endif     

A quick fix is below, but I'm not 100% sure about it yet.
Let's see.


thanks,

Takashi

---
diff --git a/sound/pci/au88x0/au88x0_core.c b/sound/pci/au88x0/au88x0_core.c
index 525f881..3fe3dbe 100644
--- a/sound/pci/au88x0/au88x0_core.c
+++ b/sound/pci/au88x0/au88x0_core.c
@@ -2461,7 +2461,8 @@ static irqreturn_t vortex_interrupt(int irq, void *dev_id)
 #ifndef CHIP_AU8810
 		for (i = 0; i < NR_WT; i++) {
 			if (vortex->dma_wt[i].fifo_status == FIFO_START) {
-				if (vortex_wtdma_bufshift(vortex, i)) ;
+				if (!vortex_wtdma_bufshift(vortex, i))
+					continue;
 				spin_unlock(&vortex->lock);
 				snd_pcm_period_elapsed(vortex->dma_wt[i].
 						       substream);


More information about the Alsa-devel mailing list