kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] ALSA: timer: remove some dead code
@ 2017-03-31 15:21 Dan Carpenter
  2017-03-31 15:27 ` Takashi Iwai
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2017-03-31 15:21 UTC (permalink / raw)
  To: Jaroslav Kysela
  Cc: kernel-janitors, alsa-devel, Alexandre Belloni, Takashi Iwai, Kangjie Lu

We just checked "id.card < 0" on the lines before so we know it's not
true here.  We can delete that check.

Also checkpatch.pl complains about some extra curly braces so we may as
well fix that while we're at it.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/sound/core/timer.c b/sound/core/timer.c
index 6d4fbc439246..8b9e7943a83b 100644
--- a/sound/core/timer.c
+++ b/sound/core/timer.c
@@ -1430,18 +1430,13 @@ static int snd_timer_user_next_device(struct snd_timer_id __user *_tid)
 			if (id.card < 0) {
 				id.card = 0;
 			} else {
-				if (id.card < 0) {
-					id.card = 0;
+				if (id.device < 0) {
+					id.device = 0;
 				} else {
-					if (id.device < 0) {
-						id.device = 0;
-					} else {
-						if (id.subdevice < 0) {
-							id.subdevice = 0;
-						} else {
-							id.subdevice++;
-						}
-					}
+					if (id.subdevice < 0)
+						id.subdevice = 0;
+					else
+						id.subdevice++;
 				}
 			}
 			list_for_each(p, &snd_timer_list) {

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

* Re: [PATCH 1/2] ALSA: timer: remove some dead code
  2017-03-31 15:21 [PATCH 1/2] ALSA: timer: remove some dead code Dan Carpenter
@ 2017-03-31 15:27 ` Takashi Iwai
  0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2017-03-31 15:27 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Jaroslav Kysela, alsa-devel, Alexandre Belloni, Kangjie Lu,
	kernel-janitors

On Fri, 31 Mar 2017 17:21:41 +0200,
Dan Carpenter wrote:
> 
> We just checked "id.card < 0" on the lines before so we know it's not
> true here.  We can delete that check.
> 
> Also checkpatch.pl complains about some extra curly braces so we may as
> well fix that while we're at it.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Applied, thanks.


Takashi

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

end of thread, other threads:[~2017-03-31 15:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-31 15:21 [PATCH 1/2] ALSA: timer: remove some dead code Dan Carpenter
2017-03-31 15:27 ` Takashi Iwai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).