Quellcode durchsuchen

ALSA: emu10k1_patch: Use swap macro in snd_emu10k1_sample_new

Make use of the swap macro and remove unnecessary variable *tmp*. This
makes the code easier to read and maintain.

This code was detected with the help of Coccinelle.

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Gustavo A. R. Silva vor 7 Jahren
Ursprung
Commit
e2d2f24049
1 geänderte Dateien mit 2 neuen und 5 gelöschten Zeilen
  1. 2 5
      sound/pci/emu10k1/emu10k1_patch.c

+ 2 - 5
sound/pci/emu10k1/emu10k1_patch.c

@@ -70,11 +70,8 @@ snd_emu10k1_sample_new(struct snd_emux *rec, struct snd_sf_sample *sp,
 		loopend = sampleend;
 		loopend = sampleend;
 
 
 	/* be sure loop points start < end */
 	/* be sure loop points start < end */
-	if (sp->v.loopstart >= sp->v.loopend) {
-		int tmp = sp->v.loopstart;
-		sp->v.loopstart = sp->v.loopend;
-		sp->v.loopend = tmp;
-	}
+	if (sp->v.loopstart >= sp->v.loopend)
+		swap(sp->v.loopstart, sp->v.loopend);
 
 
 	/* compute true data size to be loaded */
 	/* compute true data size to be loaded */
 	truesize = sp->v.size + BLANK_HEAD_SIZE;
 	truesize = sp->v.size + BLANK_HEAD_SIZE;