projects
/
platform
/
kernel
/
linux-rpi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c11117b
)
ALSA: seq: replace ternary operator with max()
author
Guo Zhengkui
<guozhengkui@vivo.com>
Tue, 17 May 2022 06:25:17 +0000
(14:25 +0800)
committer
Takashi Iwai
<tiwai@suse.de>
Tue, 17 May 2022 06:49:42 +0000
(08:49 +0200)
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>
sound/core/seq/seq_ports.c
patch
|
blob
|
history
diff --git
a/sound/core/seq/seq_ports.c
b/sound/core/seq/seq_ports.c
index 84d78630463e4261d7bffaecf9e09ac095b1868a..25fcf5a2c71c320e02c2f7f9833cb73fe230adb0 100644
(file)
--- a/
sound/core/seq/seq_ports.c
+++ b/
sound/core/seq/seq_ports.c
@@
-139,7
+139,7
@@
struct snd_seq_client_port *snd_seq_create_port(struct snd_seq_client *client,
port_subs_info_init(&new_port->c_dest);
snd_use_lock_use(&new_port->use_lock);
- num =
port >= 0 ? port : 0
;
+ num =
max(port, 0)
;
mutex_lock(&client->ports_mutex);
write_lock_irq(&client->ports_lock);
list_for_each_entry(p, &client->ports_list_head, list) {