Skip to contentSkip to conversation

swiotlb: fix inversed DMA_ATTR_NO_WARN test

PATCH New Prasanthi Chellakumar 1 participant 1 message May 10, 2018

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

PATCH 1/1 swiotlb: fix inversed DMA_ATTR_NO_WARN test

From: Michel Dänzer <[email protected]>

The result was printing the warning only when we were explicitly asked not to.

Fixes 0176adb004065d6815a8e67946752df4cd947c5b "swiotlb: refactor

coherent buffer allocation"

---
 lib/swiotlb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/swiotlb.c +1 -1
index fece575..12fbaa4 100644
@@ -737,7 +737,7 @@ swiotlb_alloc_buffer(struct device *dev, size_t size, dma_addr_t *dma_handle,
 	swiotlb_tbl_unmap_single(dev, phys_addr, size, DMA_TO_DEVICE,
 			DMA_ATTR_SKIP_CPU_SYNC);
 out_warn:
-	if ((attrs & DMA_ATTR_NO_WARN) && printk_ratelimit()) {
+	if (!(attrs & DMA_ATTR_NO_WARN) && printk_ratelimit()) {
 		dev_warn(dev,
 			"swiotlb: coherent allocation failed, size=%zu\n",
 			size);
Signature · 1 line
2.7.4