Skip to content

Commit 44d3076

Browse files
Guo Zhengkuitiwai
authored andcommitted
ALSA: seq: replace ternary operator with max()
Fix the following coccicheck warning: sound/core/seq/seq_ports.c:142:12-14: WARNING opportunity for max() Signed-off-by: Guo Zhengkui <guozhengkui@vivo.com> Link: https://lore.kernel.org/r/20220517062518.123292-1-guozhengkui@vivo.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
1 parent c11117b commit 44d3076

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

sound/core/seq/seq_ports.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ struct snd_seq_client_port *snd_seq_create_port(struct snd_seq_client *client,
139139
port_subs_info_init(&new_port->c_dest);
140140
snd_use_lock_use(&new_port->use_lock);
141141

142-
num = port >= 0 ? port : 0;
142+
num = max(port, 0);
143143
mutex_lock(&client->ports_mutex);
144144
write_lock_irq(&client->ports_lock);
145145
list_for_each_entry(p, &client->ports_list_head, list) {

0 commit comments

Comments
 (0)