linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Bjorn Andersson <andersson@kernel.org>
Cc: Stefan Wahren <wahrenst@gmx.net>, Vinod Koul <vkoul@kernel.org>,
	Thomas Andreatta <thomasandreatta2000@gmail.com>,
	Caleb Sander Mateos <csander@purestorage.com>,
	dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-rpi-kernel@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org,
	linux-arm-msm@vger.kernel.org,
	Olivier Dautricourt <olivierdautricourt@gmail.com>,
	Stefan Roese <sr@denx.de>,
	Florian Fainelli <florian.fainelli@broadcom.com>,
	Broadcom internal kernel review list
	<bcm-kernel-feedback-list@broadcom.com>,
	Ray Jui <rjui@broadcom.com>,
	Scott Branden <sbranden@broadcom.com>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>,
	Daniel Mack <daniel@zonque.org>,
	Haojian Zhuang <haojian.zhuang@gmail.com>,
	Robert Jarzmik <robert.jarzmik@free.fr>,
	Lizhi Hou <lizhi.hou@amd.com>, Brian Xu <brian.xu@amd.com>,
	Raj Kumar Rampelli <raj.kumar.rampelli@amd.com>,
	Michal Simek <michal.simek@amd.com>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH v2 01/13] scatterlist: introduce sg_nents_for_dma() helper
Date: Mon, 10 Nov 2025 17:33:29 +0200	[thread overview]
Message-ID: <aRIFyR0maAfZF7MN@smile.fi.intel.com> (raw)
In-Reply-To: <jea2owcqtjeomlbwkfopt3ujsnakn4p3xeyqhh7s4kowf7k7dr@deyg5pky5udo>

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@kernel.org>

Thanks!

-- 
With Best Regards,
Andy Shevchenko




  reply	other threads:[~2025-11-10 15:33 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-10 10:23 [PATCH v2 00/13] dmaengine: introduce sg_nents_for_dma() and convert users Andy Shevchenko
2025-11-10 10:23 ` [PATCH v2 01/13] scatterlist: introduce sg_nents_for_dma() helper Andy Shevchenko
2025-11-10 15:05   ` Bjorn Andersson
2025-11-10 15:21     ` Bjorn Andersson
2025-11-10 15:33       ` Andy Shevchenko [this message]
2025-11-10 16:34         ` Bjorn Andersson
2025-11-10 10:23 ` [PATCH v2 02/13] dmaengine: altera-msgdma: use " Andy Shevchenko
2025-11-10 10:23 ` [PATCH v2 03/13] dmaengine: axi-dmac: " Andy Shevchenko
2025-11-10 10:23 ` [PATCH v2 04/13] dmaengine: bcm2835-dma: " Andy Shevchenko
2025-11-10 10:23 ` [PATCH v2 05/13] dmaengine: dw-axi-dmac: " Andy Shevchenko
2025-11-10 10:23 ` [PATCH v2 06/13] dmaengine: k3dma: " Andy Shevchenko
2025-11-10 10:23 ` [PATCH v2 07/13] dmaengine: lgm: " Andy Shevchenko
2025-11-22  9:28   ` Vinod Koul
2025-11-24 12:10     ` Andy Shevchenko
2025-11-10 10:23 ` [PATCH v2 08/13] dmaengine: pxa-dma: " Andy Shevchenko
2025-11-10 10:23 ` [PATCH v2 09/13] dmaengine: qcom: adm: " Andy Shevchenko
2025-11-10 15:07   ` Bjorn Andersson
2025-11-10 10:23 ` [PATCH v2 10/13] dmaengine: qcom: bam_dma: " Andy Shevchenko
2025-11-10 15:07   ` Bjorn Andersson
2025-11-10 10:23 ` [PATCH v2 11/13] dmaengine: sa11x0: " Andy Shevchenko
2025-11-10 10:23 ` [PATCH v2 12/13] dmaengine: sh: " Andy Shevchenko
2025-11-10 10:23 ` [PATCH v2 13/13] dmaengine: xilinx: xdma: " Andy Shevchenko
2025-11-10 15:22 ` [PATCH v2 00/13] dmaengine: introduce sg_nents_for_dma() and convert users Bjorn Andersson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aRIFyR0maAfZF7MN@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=Eugeniy.Paltsev@synopsys.com \
    --cc=akpm@linux-foundation.org \
    --cc=andersson@kernel.org \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=brian.xu@amd.com \
    --cc=csander@purestorage.com \
    --cc=daniel@zonque.org \
    --cc=dmaengine@vger.kernel.org \
    --cc=florian.fainelli@broadcom.com \
    --cc=haojian.zhuang@gmail.com \
    --cc=lars@metafoo.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rpi-kernel@lists.infradead.org \
    --cc=lizhi.hou@amd.com \
    --cc=michal.simek@amd.com \
    --cc=olivierdautricourt@gmail.com \
    --cc=raj.kumar.rampelli@amd.com \
    --cc=rjui@broadcom.com \
    --cc=robert.jarzmik@free.fr \
    --cc=sbranden@broadcom.com \
    --cc=sr@denx.de \
    --cc=thomasandreatta2000@gmail.com \
    --cc=vkoul@kernel.org \
    --cc=wahrenst@gmx.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).