Skip to contentSkip to conversation

ALSA: seq: remove redundant unsigned comparison to zero

PATCH Applied Wang Weiyang 2 participants 2 messages Jul 21, 2023 Sound

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ALSA: seq: remove redundant unsigned comparison to zero

Since struct snd_ump_block_info::first_group is unsigned char, comparison to zero is redundant

---
 sound/core/seq/seq_ump_client.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
sound/core/seq/seq_ump_client.c +1 -2
index fe21c801af74..f26a1812dfa7 100644
@@ -298,8 +298,7 @@ static void update_group_attrs(struct seq_ump_client *client)
 	}
 
 	list_for_each_entry(fb, &client->ump->block_list, list) {
-		if (fb->info.first_group < 0 ||
-		    fb->info.first_group + fb->info.num_groups > SNDRV_UMP_MAX_GROUPS)
+		if (fb->info.first_group + fb->info.num_groups > SNDRV_UMP_MAX_GROUPS)
 			break;
 		group = &client->groups[fb->info.first_group];
 		for (i = 0; i < fb->info.num_groups; i++, group++) {
Signature · 1 line
2.25.1
Applied
#1 lore raw
Quoted 5 lines · Wang Weiyang

Since struct snd_ump_block_info::first_group is unsigned char, comparison to zero is redundant

Thanks, applied with a proper Fix tag now.

Takashi