CC: [email protected] BCC: [email protected] CC: [email protected] TO: Denis Efremov <[email protected]> CC: Julia Lawall <[email protected]> CC: Jaroslav Kysela <[email protected]> CC: Takashi Iwai <[email protected]> CC: [email protected] CC: [email protected]
From: kernel test robot <[email protected]> sound/core/seq/seq_ports.c:142:12-14: WARNING opportunity for max() Check for opencoded min(), max() implementations. Generated patches sometimes require adding a cast to fix compile warning. Warnings/patches scope intentionally limited to a function body. Generated by: scripts/coccinelle/misc/minmax.cocci CC: Denis Efremov <[email protected]> Reported-by: kernel test robot <[email protected]> Signed-off-by: kernel test robot <[email protected]> --- tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: ae085d7f9365de7da27ab5c0d16b12d51ea7fca9 commit: 5f66f73b9ff4dcabd4e2405ba9c32e80e02f9408 coccinelle: misc: add minmax script :::::: branch date: 10 hours ago :::::: commit date: 11 months ago Please take the patch only if it's a positive warning. Thanks! sound/core/seq/seq_ports.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- 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_crea 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) { _______________________________________________ kbuild mailing list -- [email protected] To unsubscribe send an email to [email protected]
