Commit d07a74a5 authored by Dr. David Alan Gilbert's avatar Dr. David Alan Gilbert Committed by Dan Williams

dmaengine: fix missing 'cnt' in ?: in dmatest

Hi,
  On the latest tree my compiler has started giving the warning:

drivers/dma/dmatest.c:575:28: warning: the omitted middle operand in ?: will always be ?true?, suggest explicit middle operand [-Wparentheses]

The following patch fixes the missing middle clause with the same
fix that Nicolas Ferre used in the similar clauses.
(There seems to have been a race between him fixing that and
the extra clause going in a little later).

I don't actually know the dmatest code/structures, nor do I own
any hardware to test it on (assuming it needs a DMA engine);
 but this patch builds, the existing code is almost certainly
wrong and the fix is the same as the corresponding lines above it.

(WTH is x=y?:z legal C anyway?)
Signed-off-by: default avatarDr. David Alan Gilbert <linux@treblig.org>
Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Reported-by: default avatarPaul Gortmaker <paul.gortmaker@windriver.com>
Acked-by: default avatarNicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
parent dcd6c922
...@@ -599,7 +599,7 @@ static int dmatest_add_channel(struct dma_chan *chan) ...@@ -599,7 +599,7 @@ static int dmatest_add_channel(struct dma_chan *chan)
} }
if (dma_has_cap(DMA_PQ, dma_dev->cap_mask)) { if (dma_has_cap(DMA_PQ, dma_dev->cap_mask)) {
cnt = dmatest_add_threads(dtc, DMA_PQ); cnt = dmatest_add_threads(dtc, DMA_PQ);
thread_count += cnt > 0 ?: 0; thread_count += cnt > 0 ? cnt : 0;
} }
pr_info("dmatest: Started %u threads using %s\n", pr_info("dmatest: Started %u threads using %s\n",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment