Skip to contentSkip to conversation

dmatest: store correct thread count in dmatest_add_channel()

PATCH In review Dan Carpenter 2 participants 3 messages Nov 24, 2011 – Jan 10, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dmatest: store correct thread count in dmatest_add_channel()

The original code added 1 to the thread_count, but the intent was to add += cnt.

drivers/dma/dmatest.c +1 -1
index 2b8661b..24225f0 100644
@@ -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 lore raw

Ping?

regards,
dan carpenter

Quoted 22 lines · Dan Carpenter

The original code added 1 to the thread_count, but the intent was to add += cnt.

drivers/dma/dmatest.c +1 -2
index 2b8661b..24225f0 100644
@@ -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",
--

To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html