| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
 Re: [PATCH v1 16/16] dma-mapping: Disallow .map_sg operations from returning zero on error
 
To: Logan Gunthorpe <logang@xxxxxxxxxxxx>From: Christoph Hellwig <hch@xxxxxx>Date: Fri, 16 Jul 2021 08:33:32 +0200Cc: linux-kernel@xxxxxxxxxxxxxxx, linux-alpha@xxxxxxxxxxxxxxx,	linux-arm-kernel@xxxxxxxxxxxxxxxxxxx, linux-ia64@xxxxxxxxxxxxxxx,	linux-mips@xxxxxxxxxxxxxxx, linuxppc-dev@xxxxxxxxxxxxxxxx,	linux-s390@xxxxxxxxxxxxxxx, sparclinux@xxxxxxxxxxxxxxx,	iommu@xxxxxxxxxxxxxxxxxxxxxxxxxx, linux-parisc@xxxxxxxxxxxxxxx,	xen-devel@xxxxxxxxxxxxxxxxxxxx, Christoph Hellwig <hch@xxxxxx>,	Marek Szyprowski <m.szyprowski@xxxxxxxxxxx>,	Robin Murphy <robin.murphy@xxxxxxx>,	Stephen Bates <sbates@xxxxxxxxxxxx>,	Martin Oliveira <martin.oliveira@xxxxxxxxxxxxx>Delivery-date: Fri, 16 Jul 2021 06:33:36 +0000List-id: Xen developer discussion <xen-devel.lists.xenproject.org> 
 On Thu, Jul 15, 2021 at 10:45:44AM -0600, Logan Gunthorpe wrote:
> @@ -194,6 +194,8 @@ static int __dma_map_sg_attrs(struct device *dev, struct 
> scatterlist *sg,
>       else
>               ents = ops->map_sg(dev, sg, nents, dir, attrs);
>  
> +     WARN_ON_ONCE(ents == 0);
Turns this into a negative error code while we're at it, just to keep
the callers sane?
 
 |