Skip to content

Commit

Permalink
swiotlb: fix inversed DMA_ATTR_NO_WARN test
Browse files Browse the repository at this point in the history
The result was printing the warning only when we were explicitly asked
not to.

Cc: [email protected]
Fixes: 0176adb "swiotlb: refactor
 coherent buffer allocation"
Signed-off-by: Michel Dänzer <[email protected]>
Reviewed-by: Christian König <[email protected]>.
Signed-off-by: Christoph Hellwig <[email protected]>
  • Loading branch information
Michel Dänzer authored and Christoph Hellwig committed May 2, 2018
1 parent 2d618bd commit 892a0be
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/swiotlb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 892a0be

Please sign in to comment.