alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* Re: ASoC: Intel: sst: Add IPC handling
@ 2014-11-25  9:20 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2014-11-25  9:20 UTC (permalink / raw)
  To: vinod.koul; +Cc: alsa-devel

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2014-11-25  9:20 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-25  9:20 ASoC: Intel: sst: Add IPC handling Dan Carpenter

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).