[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aRIFyR0maAfZF7MN@smile.fi.intel.com>
Date: Mon, 10 Nov 2025 17:33:29 +0200
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Bjorn Andersson <andersson@...nel.org>
Cc: Stefan Wahren <wahrenst@....net>, Vinod Koul <vkoul@...nel.org>,
Thomas Andreatta <thomasandreatta2000@...il.com>,
Caleb Sander Mateos <csander@...estorage.com>,
dmaengine@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-rpi-kernel@...ts.infradead.org,
linux-arm-kernel@...ts.infradead.org, linux-arm-msm@...r.kernel.org,
Olivier Dautricourt <olivierdautricourt@...il.com>,
Stefan Roese <sr@...x.de>,
Florian Fainelli <florian.fainelli@...adcom.com>,
Broadcom internal kernel review list <bcm-kernel-feedback-list@...adcom.com>,
Ray Jui <rjui@...adcom.com>, Scott Branden <sbranden@...adcom.com>,
Lars-Peter Clausen <lars@...afoo.de>,
Eugeniy Paltsev <Eugeniy.Paltsev@...opsys.com>,
Daniel Mack <daniel@...que.org>,
Haojian Zhuang <haojian.zhuang@...il.com>,
Robert Jarzmik <robert.jarzmik@...e.fr>,
Lizhi Hou <lizhi.hou@....com>, Brian Xu <brian.xu@....com>,
Raj Kumar Rampelli <raj.kumar.rampelli@....com>,
Michal Simek <michal.simek@....com>,
Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH v2 01/13] scatterlist: introduce sg_nents_for_dma() helper
On Mon, Nov 10, 2025 at 09:21:18AM -0600, Bjorn Andersson wrote:
> On Mon, Nov 10, 2025 at 09:05:26AM -0600, Bjorn Andersson wrote:
> > On Mon, Nov 10, 2025 at 11:23:28AM +0100, Andy Shevchenko wrote:
...
> > > int sg_nents(struct scatterlist *sg);
> > > int sg_nents_for_len(struct scatterlist *sg, u64 len);
> > > +int sg_nents_for_dma(struct scatterlist *sgl, unsigned int sglen, size_t len);
^^^
> > > +int sg_nents_for_dma(struct scatterlist *sgl, unsigned int sglen, size_t len)
>
> All but two clients store the value in an unsigned int. Changing the
> return type to unsigned int also signals that the function is just
> returning a count (no errors).
The type is chosen for the consistency with the existing APIs.
So, I prefer consistency in this case, if we need to change type, we need to do
that for all above APIs I believe. And this is out of the scope here.
Personally I was also puzzled of the choice as *nents members are all unsigned
int in the scatterlist.h.
...
> > We need an EXPORT_SYMBOL() here.
Good catch! I'll add it in next version.
> > With that, this looks good to me.
> >
> > Reviewed-by: Bjorn Andersson <andersson@...nel.org>
Thanks!
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists