Re: [PATCH v2 1/1] docs: dma: correct dma_set_mask() sample code
From: Frank Li
Date: Mon Aug 17 2026 - 14:43:44 EST
On Mon, Aug 17, 2026 at 07:17:31PM +0200, Michal Pecio wrote:
> [You don't often get email from michal.pecio@xxxxxxxxx. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
>
> On Mon, 17 Aug 2026 10:50:35 -0500, Frank Li wrote:
> > On Sun, Aug 16, 2026 at 07:10:44AM +0200, Michal Pecio wrote:
> > > No realistic chance of the dev->dma_mask check (below) giving -EIO?
> >
> > dma_mask is pointer, which already initilized by bus driver before
> > call to probe.
> >
> > For example
> >
> > https://elixir.bootlin.com/linux/v7.1.8/source/drivers/base/platform.c#L634
> >
> > If you find one, which bus driver have not init it, please high light
> > it.
> >
> > > > dma_supported() will call dma_direct_supported or iommux's
> > > > dma_supported call back function.
> > >
> > > Aapparently, it may also use some 'dma_map_ops' and there is a bunch
> > > of those spread over drivers/ and arch/. But I gather they are
> > > expected to behave similarly as the functions named above?
> >
> > I grep it and checked at that time, all return 1 when >= 32. Now more
> > powerfull check tools avaible, you can double check it.
>
> Thank you. Sounds like it should work then, though I think that
> checking return status won't harm, just to cover unusual cases like
> regression in some obscure arch or people with buggy out of tree
> patches (which they "forget" to mention they are using).
Now, prefer don't check when >= 32 to keep code clean.
Frank
>
> Regards,
> Michal