Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7373c2a9 authored by Gustavo A. R. Silva's avatar Gustavo A. R. Silva Committed by Takashi Iwai
Browse files

ALSA: emu8000: Use swap macro in snd_emu8000_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: default avatarGustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent e2d2f240
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -165,11 +165,8 @@ snd_emu8000_sample_new(struct snd_emux *rec, struct snd_sf_sample *sp,
		return 0;

	/* 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 */
	truesize = sp->v.size;