ALSA: emu8000: Use swap macro in snd_emu8000_sample_new
PATCH 1/1 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 Gustavo A. R. Silva <[email protected]>
--- sound/isa/sb/emu8000_patch.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
sound/isa/sb/emu8000_patch.c +2 -5
@@ -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;
Signature · 1 line
2.7.4
Takashi Iwai
AppliedQuoted 7 lines · Gustavo A. R. Silva
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 <[email protected]>
Applied, thanks.
(BTW one of your addresses in Cc was a typo; removed in this reply)
Takashi
Quoted 6 lines · Takashi Iwai
Quoted 4 lines · Gustavo A. R. Silva
Make use of the swap macro and remove unnecessary variable *tmp*. This makes the code easier to read and maintain.
Quoted 8 lines
Quoted 3 lines
This code was detected with the help of Coccinelle.
Signed-off-by Gustavo A. R. Silva <[email protected]>Applied, thanks.
(BTW one of your addresses in Cc was a typo; removed in this reply)
Thanks!
--
Gustavo