* [PATCH] dmatest: fix merge error resulting in incorrect count handling
@ 2012-01-19 0:21 Paul Gortmaker
2012-01-19 8:21 ` Nicolas Ferre
0 siblings, 1 reply; 2+ messages in thread
From: Paul Gortmaker @ 2012-01-19 0:21 UTC (permalink / raw)
To: linux-kernel; +Cc: Paul Gortmaker, Nicolas Ferre, Dan Williams, Vinod Koul
We currently see this warning:
drivers/dma/dmatest.c: In function ‘dmatest_add_channel’:
drivers/dma/dmatest.c:602:28: warning: the omitted middle operand
in ?: will always be ‘true’, suggest explicit middle operand [-Wparentheses]
It happens because commit f1aef8b6e6abf32a3a269542f95a19e2cb319f6c
"dmaengine: dmatest: correct thread_count while using multiple thread per channel"
fixed the only two instances of this issue in the code, but then the
commit 58691d64c44ae41ddf098ecb31e9a994026e3cff "dmatest: add pq support"
was based on the old (unfixed) code, and so it reintroduced an instance
of this error. Using git describe, the baseline delta is apparent:
dmatest: correct thread_count v2.6.30-8-gf1aef8b
dmatest: add pq support v2.6.29-rc8-80-g58691d6
Inspection of f1aef8b and/or the surrounding code leads one to the
obvious fix.
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
CC: Nicolas Ferre <nicolas.ferre@atmel.com>
CC: Dan Williams <dan.j.williams@intel.com>
CC: Vinod Koul <vinod.koul@intel.com>
---
[After creating this patch, I noticed it came up before in the
lkml archives, but a fix never got applied. At least now the
real root cause is documented in this commit log.]
diff --git a/drivers/dma/dmatest.c b/drivers/dma/dmatest.c
index 2b8661b..24225f0 100644
--- a/drivers/dma/dmatest.c
+++ b/drivers/dma/dmatest.c
@@ -599,7 +599,7 @@ static int dmatest_add_channel(struct dma_chan *chan)
}
if (dma_has_cap(DMA_PQ, dma_dev->cap_mask)) {
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",
--
1.7.7.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] dmatest: fix merge error resulting in incorrect count handling
2012-01-19 0:21 [PATCH] dmatest: fix merge error resulting in incorrect count handling Paul Gortmaker
@ 2012-01-19 8:21 ` Nicolas Ferre
0 siblings, 0 replies; 2+ messages in thread
From: Nicolas Ferre @ 2012-01-19 8:21 UTC (permalink / raw)
To: Paul Gortmaker; +Cc: linux-kernel, Dan Williams, Vinod Koul
On 01/19/2012 01:21 AM, Paul Gortmaker :
> We currently see this warning:
>
> drivers/dma/dmatest.c: In function ‘dmatest_add_channel’:
> drivers/dma/dmatest.c:602:28: warning: the omitted middle operand
> in ?: will always be ‘true’, suggest explicit middle operand [-Wparentheses]
>
> It happens because commit f1aef8b6e6abf32a3a269542f95a19e2cb319f6c
>
> "dmaengine: dmatest: correct thread_count while using multiple thread per channel"
>
> fixed the only two instances of this issue in the code, but then the
> commit 58691d64c44ae41ddf098ecb31e9a994026e3cff "dmatest: add pq support"
> was based on the old (unfixed) code, and so it reintroduced an instance
> of this error. Using git describe, the baseline delta is apparent:
>
> dmatest: correct thread_count v2.6.30-8-gf1aef8b
> dmatest: add pq support v2.6.29-rc8-80-g58691d6
>
> Inspection of f1aef8b and/or the surrounding code leads one to the
> obvious fix.
>
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
> CC: Nicolas Ferre <nicolas.ferre@atmel.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
> CC: Dan Williams <dan.j.williams@intel.com>
> CC: Vinod Koul <vinod.koul@intel.com>
>
> ---
>
> [After creating this patch, I noticed it came up before in the
> lkml archives, but a fix never got applied. At least now the
> real root cause is documented in this commit log.]
>
> diff --git a/drivers/dma/dmatest.c b/drivers/dma/dmatest.c
> index 2b8661b..24225f0 100644
> --- a/drivers/dma/dmatest.c
> +++ b/drivers/dma/dmatest.c
> @@ -599,7 +599,7 @@ static int dmatest_add_channel(struct dma_chan *chan)
> }
> if (dma_has_cap(DMA_PQ, dma_dev->cap_mask)) {
> 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",
--
Nicolas Ferre
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-01-19 8:21 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-19 0:21 [PATCH] dmatest: fix merge error resulting in incorrect count handling Paul Gortmaker
2012-01-19 8:21 ` Nicolas Ferre
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).