Skip to content

Commit

Permalink
dmaengine: pl330: Remove non-NULL check for pl330_submit_req parameters
Browse files Browse the repository at this point in the history
The pl330_submit_req() checked supplied 'struct pl330_thread thrd' and
'struct dma_pl330_desc desc' parameters for non-NULL. However these
checks are useless because supplied arguments won't be NULL.

The pl330_submit_req() is called in only one place and:
1. 'desc' is already dereferenced in fill_queue() before calling
   pl330_submit_req().
2. 'thrd' is always dereferenced after calling
   fill_queue()->pl330_submit_req().

Removing the checks for non-NULL values fixes following warning:
drivers/dma/pl330.c:1376 pl330_submit_req() warn: variable dereferenced before check 'thrd' (see line 1367)

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
  • Loading branch information
Krzysztof Kozlowski authored and Vinod Koul committed Oct 15, 2014
1 parent fe6cf28 commit 937cb2f
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions drivers/dma/pl330.c
Original file line number Diff line number Diff line change
Expand Up @@ -1372,10 +1372,6 @@ static int pl330_submit_req(struct pl330_thread *thrd,
u32 ccr;
int ret = 0;

/* No Req or Unacquired Channel or DMAC */
if (!desc || !thrd || thrd->free)
return -EINVAL;

regs = thrd->dmac->base;

if (pl330->state == DYING
Expand Down

0 comments on commit 937cb2f

Please sign in to comment.