diff options
author | Logan Gunthorpe <logang@deltatee.com> | 2021-08-09 17:13:31 +0200 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2021-08-09 17:15:02 +0200 |
commit | d03c54419274f96434e2ad74e59e67ec6d54ca86 (patch) | |
tree | 01226f9a07092a6c4d83ecf6e6adf594c595bafa /kernel/dma/mapping.c | |
parent | 66ab63104f9cab09209851fef168f5972d791903 (diff) | |
download | linux-d03c54419274f96434e2ad74e59e67ec6d54ca86.tar.bz2 |
dma-mapping: disallow .map_sg operations from returning zero on error
Now that all the .map_sg operations have been converted to returning
proper error codes, drop the code to handle a zero return value,
add a warning if a zero is returned.
Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'kernel/dma/mapping.c')
-rw-r--r-- | kernel/dma/mapping.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/kernel/dma/mapping.c b/kernel/dma/mapping.c index 21e550076be5..967b62692102 100644 --- a/kernel/dma/mapping.c +++ b/kernel/dma/mapping.c @@ -197,7 +197,7 @@ static int __dma_map_sg_attrs(struct device *dev, struct scatterlist *sg, if (ents > 0) debug_dma_map_sg(dev, sg, nents, ents, dir); else if (WARN_ON_ONCE(ents != -EINVAL && ents != -ENOMEM && - ents != -EIO && ents != 0)) + ents != -EIO)) return -EIO; return ents; @@ -261,8 +261,6 @@ int dma_map_sgtable(struct device *dev, struct sg_table *sgt, int nents; nents = __dma_map_sg_attrs(dev, sgt->sgl, sgt->orig_nents, dir, attrs); - if (nents == 0) - return -EIO; if (nents < 0) return nents; sgt->nents = nents; |