summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2024-07-19 06:06:28 +0200
committerChristoph Hellwig <hch@lst.de>2024-08-29 07:22:42 +0300
commit560a861ab4174b42240157ab5cebe36b8c7bc418 (patch)
treec40ffdfdfa03e4f09be5d1e26d3da0910a36ab56
parentc42a01264ba1497eb3193c08ff3c2656d98250a6 (diff)
downloadlwn-560a861ab4174b42240157ab5cebe36b8c7bc418.tar.gz
lwn-560a861ab4174b42240157ab5cebe36b8c7bc418.zip
dma-mapping: don't return errors from dma_set_seg_boundary
A NULL dev->dma_parms indicates either a bus that is not DMA capable or grave bug in the implementation of the bus code. There isn't much the driver can do in terms of error handling for either case, so just warn and continue as DMA operations will fail anyway. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Robin Murphy <robin.murphy@arm.com> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
-rw-r--r--include/linux/dma-mapping.h10
1 files changed, 4 insertions, 6 deletions
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h
index cfd6bafec3f9..6bd1333dbacb 100644
--- a/include/linux/dma-mapping.h
+++ b/include/linux/dma-mapping.h
@@ -559,13 +559,11 @@ static inline unsigned long dma_get_seg_boundary_nr_pages(struct device *dev,
return (dma_get_seg_boundary(dev) >> page_shift) + 1;
}
-static inline int dma_set_seg_boundary(struct device *dev, unsigned long mask)
+static inline void dma_set_seg_boundary(struct device *dev, unsigned long mask)
{
- if (dev->dma_parms) {
- dev->dma_parms->segment_boundary_mask = mask;
- return 0;
- }
- return -EIO;
+ if (WARN_ON_ONCE(!dev->dma_parms))
+ return;
+ dev->dma_parms->segment_boundary_mask = mask;
}
static inline unsigned int dma_get_min_align_mask(struct device *dev)