All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ALSA: emu8000: Use swap macro in snd_emu8000_sample_new
@ 2018-07-17 15:06 Gustavo A. R. Silva
  2018-07-17 15:19   ` Takashi Iwai
  0 siblings, 1 reply; 4+ messages in thread
From: Gustavo A. R. Silva @ 2018-07-17 15:06 UTC (permalink / raw)
  To: Jaroslav Kysela, Takashi Iwai
  Cc: alsa-devel, linux-kernel, 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 <gustavo@embeddedor.com>
---
 sound/isa/sb/emu8000_patch.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/sound/isa/sb/emu8000_patch.c b/sound/isa/sb/emu8000_patch.c
index c2e41d2..d45a6b9 100644
--- a/sound/isa/sb/emu8000_patch.c
+++ b/sound/isa/sb/emu8000_patch.c
@@ -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;
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] ALSA: emu8000: Use swap macro in snd_emu8000_sample_new
  2018-07-17 15:06 [PATCH] ALSA: emu8000: Use swap macro in snd_emu8000_sample_new Gustavo A. R. Silva
@ 2018-07-17 15:19   ` Takashi Iwai
  0 siblings, 0 replies; 4+ messages in thread
From: Takashi Iwai @ 2018-07-17 15:19 UTC (permalink / raw)
  To:  Gustavo A. R. Silva ; +Cc: alsa-devel, linux-kernel

On Tue, 17 Jul 2018 17:06:10 +0200,
 Gustavo A. R. Silva  wrote:
> 
> 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>

Applied, thanks.

(BTW one of your addresses in Cc was a typo; removed in this reply)


Takashi

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ALSA: emu8000: Use swap macro in snd_emu8000_sample_new
@ 2018-07-17 15:19   ` Takashi Iwai
  0 siblings, 0 replies; 4+ messages in thread
From: Takashi Iwai @ 2018-07-17 15:19 UTC (permalink / raw)
  To:  Gustavo A. R. Silva ; +Cc: Jaroslav Kysela, alsa-devel, linux-kernel

On Tue, 17 Jul 2018 17:06:10 +0200,
 Gustavo A. R. Silva  wrote:
> 
> 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>

Applied, thanks.

(BTW one of your addresses in Cc was a typo; removed in this reply)


Takashi

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ALSA: emu8000: Use swap macro in snd_emu8000_sample_new
  2018-07-17 15:19   ` Takashi Iwai
  (?)
@ 2018-07-17 15:35   ` Gustavo A. R. Silva
  -1 siblings, 0 replies; 4+ messages in thread
From: Gustavo A. R. Silva @ 2018-07-17 15:35 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: Jaroslav Kysela, alsa-devel, linux-kernel



On 07/17/2018 10:19 AM, Takashi Iwai wrote:
> On Tue, 17 Jul 2018 17:06:10 +0200,
>  Gustavo A. R. Silva  wrote:
>>
>> 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>
> 
> Applied, thanks.
> 
> (BTW one of your addresses in Cc was a typo; removed in this reply)
> 

Thanks!
--
Gustavo

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-07-17 15:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-17 15:06 [PATCH] ALSA: emu8000: Use swap macro in snd_emu8000_sample_new Gustavo A. R. Silva
2018-07-17 15:19 ` Takashi Iwai
2018-07-17 15:19   ` Takashi Iwai
2018-07-17 15:35   ` Gustavo A. R. Silva

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.