Skip to contentSkip to conversation

ALSA: timer: remove some dead code

PATCH Applied Dan Carpenter 2 participants 2 messages Mar 31, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 ALSA: timer: remove some dead code

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.

sound/core/timer.c +6 -11
index 6d4fbc439246..8b9e7943a83b 100644
@@ -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) {
Applied
#1 lore raw
Quoted 8 lines · Dan Carpenter

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.

Applied, thanks.

Takashi