ALSA: sound/isa: convert nested spin_lock_irqsave to spin_lock

If spin_lock_irqsave is called twice in a row with the same second
argument, the interrupt state at the point of the second call overwrites
the value saved by the first call. Indeed, the second call does not need
to save the interrupt state, so it is changed to a simple spin_lock.

The semantic match that finds this problem is as follows:
(http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@@
expression lock1,lock2;
expression flags;
@@

*spin_lock_irqsave(lock1,flags)
... when != flags
*spin_lock_irqsave(lock2,flags)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

authored by Julia Lawall and committed by Takashi Iwai fcb2954b cb65c873

+2 -2
+2 -2
sound/isa/gus/gus_pcm.c
··· 795 795 if (!(pcmp->flags & SNDRV_GF1_PCM_PFLG_ACTIVE)) 796 796 continue; 797 797 /* load real volume - better precision */ 798 - spin_lock_irqsave(&gus->reg_lock, flags); 798 + spin_lock(&gus->reg_lock); 799 799 snd_gf1_select_voice(gus, pvoice->number); 800 800 snd_gf1_ctrl_stop(gus, SNDRV_GF1_VB_VOLUME_CONTROL); 801 801 vol = pvoice == pcmp->pvoices[0] ? gus->gf1.pcm_volume_level_left : gus->gf1.pcm_volume_level_right; 802 802 snd_gf1_write16(gus, SNDRV_GF1_VW_VOLUME, vol); 803 803 pcmp->final_volume = 1; 804 - spin_unlock_irqrestore(&gus->reg_lock, flags); 804 + spin_unlock(&gus->reg_lock); 805 805 } 806 806 spin_unlock_irqrestore(&gus->voice_alloc, flags); 807 807 return change;