diff options
author | Liam Girdwood <liam.r.girdwood@linux.intel.com> | 2014-03-06 09:56:04 -0500 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2014-03-06 21:51:05 -0500 |
commit | f69f41e1a2568f2ebdcf021fe216c1e9ba24cc1f (patch) | |
tree | ba71c6c3ea92173a99acb0f415dfe5d5a4cc89d9 | |
parent | 9202c377390f2708dece910f2e066a6308a38abc (diff) |
ASoC: Intel: Check Haswell IPC process_reply/notification return value.
Check the return value for error when processing replies and notifications.
The patch 22981243589c: "ASoC: Intel: Add Haswell/Broadwell IPC" from
> Feb 20, 2014, leads to the following imaginary static checker warning:
>
> sound/soc/intel/sst-haswell-ipc.c:898 hsw_irq_thread()
> warn: this is always true.
>
> sound/soc/intel/sst-haswell-ipc.c
> 895 /* Handle Immediate reply from DSP Core */
> 896 handled = hsw_process_reply(hsw, ipcx);
> ^^^^^^^^^^^^^^^^^
> Returns 1 on success/error and -EIO on error.
>
> 897
> 898 if (handled) {
> 899 /* clear DONE bit - tell DSP we have completed */
> 900 sst_dsp_shim_update_bits_unlocked(sst, SST_IPCX,
> 901 SST_IPCX_DONE, 0);
> 902
> 903 /* unmask Done interrupt */
> 904 sst_dsp_shim_update_bits_unlocked(sst, SST_IMRX,
> 905 SST_IMRX_DONE, 0);
> 906 }
>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
-rw-r--r-- | sound/soc/intel/sst-haswell-ipc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sound/soc/intel/sst-haswell-ipc.c b/sound/soc/intel/sst-haswell-ipc.c index 1f1576a9586a..f46bb4ddde6f 100644 --- a/sound/soc/intel/sst-haswell-ipc.c +++ b/sound/soc/intel/sst-haswell-ipc.c | |||
@@ -895,7 +895,7 @@ static irqreturn_t hsw_irq_thread(int irq, void *context) | |||
895 | /* Handle Immediate reply from DSP Core */ | 895 | /* Handle Immediate reply from DSP Core */ |
896 | handled = hsw_process_reply(hsw, ipcx); | 896 | handled = hsw_process_reply(hsw, ipcx); |
897 | 897 | ||
898 | if (handled) { | 898 | if (handled > 0) { |
899 | /* clear DONE bit - tell DSP we have completed */ | 899 | /* clear DONE bit - tell DSP we have completed */ |
900 | sst_dsp_shim_update_bits_unlocked(sst, SST_IPCX, | 900 | sst_dsp_shim_update_bits_unlocked(sst, SST_IPCX, |
901 | SST_IPCX_DONE, 0); | 901 | SST_IPCX_DONE, 0); |
@@ -913,7 +913,7 @@ static irqreturn_t hsw_irq_thread(int irq, void *context) | |||
913 | handled = hsw_process_notification(hsw); | 913 | handled = hsw_process_notification(hsw); |
914 | 914 | ||
915 | /* clear BUSY bit and set DONE bit - accept new messages */ | 915 | /* clear BUSY bit and set DONE bit - accept new messages */ |
916 | if (handled) { | 916 | if (handled > 0) { |
917 | sst_dsp_shim_update_bits_unlocked(sst, SST_IPCD, | 917 | sst_dsp_shim_update_bits_unlocked(sst, SST_IPCD, |
918 | SST_IPCD_BUSY | SST_IPCD_DONE, SST_IPCD_DONE); | 918 | SST_IPCD_BUSY | SST_IPCD_DONE, SST_IPCD_DONE); |
919 | 919 | ||