[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANiq72=qfNHf5zd8c8VkmrhE8U5_kH6yg3z4JD1N5yEfL727tA@mail.gmail.com>
Date: Fri, 8 Feb 2019 05:31:55 +0100
From: Miguel Ojeda <miguel.ojeda.sandonis@...il.com>
To: Jason Gunthorpe <jgg@...lanox.com>
Cc: Daniel Stone <daniel@...ishbar.org>, "hch@....de" <hch@....de>,
"Koenig, Christian" <Christian.Koenig@....com>,
Thomas Hellstrom <thellstrom@...are.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"yong.zhi@...el.com" <yong.zhi@...el.com>,
"daniel.vetter@...ll.ch" <daniel.vetter@...ll.ch>,
"linux-rdma@...r.kernel.org" <linux-rdma@...r.kernel.org>,
"linux-media@...r.kernel.org" <linux-media@...r.kernel.org>,
"bingbu.cao@...el.com" <bingbu.cao@...el.com>,
"tian.shu.qiu@...el.com" <tian.shu.qiu@...el.com>,
"shiraz.saleem@...el.com" <shiraz.saleem@...el.com>,
"sakari.ailus@...ux.intel.com" <sakari.ailus@...ux.intel.com>,
"dri-devel@...ts.freedesktop.org" <dri-devel@...ts.freedesktop.org>
Subject: Re: [PATCH v2] lib/scatterlist: Provide a DMA page iterator
On Thu, Feb 7, 2019 at 11:28 PM Jason Gunthorpe <jgg@...lanox.com> wrote:
>
> Commit 2db76d7c3c6d ("lib/scatterlist: sg_page_iter: support sg lists w/o
> backing pages") introduced the sg_page_iter_dma_address() function without
> providing a way to use it in the general case. If the sg_dma_len() is not
> equal to the sg length callers cannot safely use the
> for_each_sg_page/sg_page_iter_dma_address combination.
>
> Resolve this API mistake by providing a DMA specific iterator,
> for_each_sg_dma_page(), that uses the right length so
> sg_page_iter_dma_address() works as expected with all sglists.
>
> A new iterator type is introduced to provide compile-time safety against
> wrongly mixing accessors and iterators.
>
> Acked-by: Christoph Hellwig <hch@....de> (for scatterlist)
> Signed-off-by: Jason Gunthorpe <jgg@...lanox.com>
> ---
> .clang-format | 1 +
Thanks for updating the .clang-format, Jason! :-)
Cheers,
Miguel
Powered by blists - more mailing lists