From: Dan Carpenter <dan.carpenter@oracle.com>
To: vinod.koul@intel.com
Cc: alsa-devel@alsa-project.org
Subject: Re: ASoC: Intel: sst: Add IPC handling
Date: Tue, 25 Nov 2014 12:20:31 +0300 [thread overview]
Message-ID: <20141125092031.GA21784@mwanda> (raw)
Hello Vinod Koul,
The patch ea12aa4acd70: "ASoC: Intel: sst: Add IPC handling" from Oct
16, 2014, leads to the following static checker warning:
sound/soc/intel/sst/sst_ipc.c:340 sst_process_reply_mrfld()
warn: we tested 'drv_id' before and it was 'true'
sound/soc/intel/sst/sst_ipc.c
330 drv_id = msg_high.part.drv_id;
331
332 /* Check for async messages first */
333 if (drv_id == SST_ASYNC_DRV_ID) {
^^^^^^^^^^^^^^^^
This is zero.
334 /*FW sent async large message*/
335 process_fw_async_msg(sst_drv_ctx, msg);
336 return;
337 }
338
339 /* FW sent short error response for an IPC */
340 if (msg_high.part.result && drv_id && !msg_high.part.large) {
^^^^^^
So this is non-zero. The thinking behind these warnings is that maybe
a different test was intended. What does a non-zero drv_id mean which
is different from checking SST_ASYNC_DRV_ID? The intent is not clear.
In other words, would it be more readable to test "drv_id != SST_ASYNC_DRV_ID"?
But in that case, we would just leave the test out since we obviously
tested for that earlier.
341 /* 32-bit FW error code in msg_low */
342 dev_err(sst_drv_ctx->dev, "FW sent error response 0x%x", msg_low);
343 sst_wake_up_block(sst_drv_ctx, msg_high.part.result,
344 msg_high.part.drv_id,
345 msg_high.part.msg_id, NULL, 0);
346 return;
347 }
348
regards,
dan carpenter
reply other threads:[~2014-11-25 9:20 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20141125092031.GA21784@mwanda \
--to=dan.carpenter@oracle.com \
--cc=alsa-devel@alsa-project.org \
--cc=vinod.koul@intel.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).