From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Praveen Kumar <kpraveen.lkml@gmail.com>
Cc: dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org,
Vinod Koul <vkoul@kernel.org>
Subject: Re: [PATCH v2 2/3] dmaengine: Use device_match_of_node() helper
Date: Mon, 10 Nov 2025 12:43:18 +0200 [thread overview]
Message-ID: <aRHBxiOy5ecYkggI@smile.fi.intel.com> (raw)
In-Reply-To: <aRG8cVly3b7sR9Vw@u67f9ca6e60d851.ant.amazon.com>
On Mon, Nov 10, 2025 at 11:20:33AM +0100, Praveen Kumar wrote:
> On Mon, Nov 10, 2025 at 09:47:44AM +0100, Andy Shevchenko wrote:
> > Instead of open coding, use device_match_of_node() helper.
...
> > - if (np && device->dev->of_node && np != device->dev->of_node)
> > + if (np && !device_match_of_node(device->dev, np))
>
> I see a difference in what device_match_of_node does vs what was
> happening in the previous check. And, we have an unwanted double
> check of np.
Nope.
> int device_match_of_node(struct device *dev, const void *np)
> {
> return np && dev->of_node == np;
> }
>
> Instead, I would recommend,
>
> if (device->dev->of_node && !device_match_of_node(device->dev, np))
> continue;
This will be the wrong check. Think about it, yeah, it's not so trivial check
and hence the change.
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2025-11-10 10:43 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-10 8:47 [PATCH v2 0/3] dmaengine: A little cleanup and refactoring Andy Shevchenko
2025-11-10 8:47 ` [PATCH v2 1/3] dmaengine: Refactor devm_dma_request_chan() for readability Andy Shevchenko
2025-11-10 8:47 ` [PATCH v2 2/3] dmaengine: Use device_match_of_node() helper Andy Shevchenko
2025-11-10 10:20 ` Praveen Kumar
2025-11-10 10:43 ` Andy Shevchenko [this message]
2025-11-10 8:47 ` [PATCH v2 3/3] dmaengine: Sort headers alphabetically Andy Shevchenko
2026-01-08 6:43 ` [PATCH v2 0/3] dmaengine: A little cleanup and refactoring Andy Shevchenko
2026-01-09 2:33 ` Vinod Koul
2026-01-09 17:37 ` Andy Shevchenko
2026-02-25 11:23 ` Vinod Koul
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=aRHBxiOy5ecYkggI@smile.fi.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=dmaengine@vger.kernel.org \
--cc=kpraveen.lkml@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=vkoul@kernel.org \
/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