From: Dan Carpenter <dan.carpenter@oracle.com>
To: tiwai@suse.de
Cc: alsa-devel@alsa-project.org
Subject: [bug report] ALSA: seq: Fix assignment in if condition
Date: Thu, 17 Jun 2021 16:18:03 +0300 [thread overview]
Message-ID: <YMtLi0qCOc00eEcF@mwanda> (raw)
Hello Takashi Iwai,
The patch f9a6bb841f73: "ALSA: seq: Fix assignment in if condition"
from Jun 8, 2021, leads to the following static checker warning:
sound/core/seq/oss/seq_oss_init.c:99 snd_seq_oss_create_client()
warn: 'port->addr.port' is unsigned
sound/core/seq/oss/seq_oss_init.c
82
83 /* create annoucement receiver port */
84 memset(port, 0, sizeof(*port));
85 strcpy(port->name, "Receiver");
86 port->addr.client = system_client;
87 port->capability = SNDRV_SEQ_PORT_CAP_WRITE; /* receive only */
88 port->type = 0;
89
90 memset(&port_callback, 0, sizeof(port_callback));
91 /* don't set port_callback.owner here. otherwise the module counter
92 * is incremented and we can no longer release the module..
93 */
94 port_callback.event_input = receive_announce;
95 port->kernel = &port_callback;
96
97 call_ctl(SNDRV_SEQ_IOCTL_CREATE_PORT, port);
98 system_port = port->addr.port;
99 if (system_port >= 0) {
^^^^^^^^^^^^^^^^
This was from the old code. It's not clear what is going on. I think
the condition can be deleted.
100 struct snd_seq_port_subscribe subs;
101
102 memset(&subs, 0, sizeof(subs));
103 subs.sender.client = SNDRV_SEQ_CLIENT_SYSTEM;
104 subs.sender.port = SNDRV_SEQ_PORT_SYSTEM_ANNOUNCE;
105 subs.dest.client = system_client;
106 subs.dest.port = system_port;
107 call_ctl(SNDRV_SEQ_IOCTL_SUBSCRIBE_PORT, &subs);
108 }
109 rc = 0;
110
111 /* look up midi devices */
112 schedule_work(&async_lookup_work);
113
114 __error:
115 kfree(port);
116 return rc;
117 }
regards,
dan carpenter
next reply other threads:[~2021-06-17 13:19 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-17 13:18 Dan Carpenter [this message]
2021-06-17 13:41 ` [bug report] ALSA: seq: Fix assignment in if condition Takashi Iwai
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YMtLi0qCOc00eEcF@mwanda \
--to=dan.carpenter@oracle.com \
--cc=alsa-devel@alsa-project.org \
--cc=tiwai@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.