* [PATCH v3 0/3] dmaengine: A little cleanup and refactoring
@ 2026-01-09 17:35 Andy Shevchenko
2026-01-09 17:35 ` [PATCH v3 1/3] dmaengine: Refactor devm_dma_request_chan() for readability Andy Shevchenko
` (5 more replies)
0 siblings, 6 replies; 8+ messages in thread
From: Andy Shevchenko @ 2026-01-09 17:35 UTC (permalink / raw)
To: Andy Shevchenko, dmaengine, linux-kernel; +Cc: Vinod Koul
This just a set of small almost ad-hoc cleanups and refactoring.
Nothing special and nothing that changes behaviour.
Changelog v3:
- fixed checkpatch warning (mixed tabs and spaces) (Vinod)
v2: 20251110085349.3414507-1-andriy.shevchenko@linux.intel.com
Changelog v2:
- dropped not very good (and not compilable) change (LKP)
Andy Shevchenko (3):
dmaengine: Refactor devm_dma_request_chan() for readability
dmaengine: Use device_match_of_node() helper
dmaengine: Sort headers alphabetically
drivers/dma/dmaengine.c | 50 +++++++++++++++++++++--------------------
1 file changed, 26 insertions(+), 24 deletions(-)
--
2.50.1
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v3 1/3] dmaengine: Refactor devm_dma_request_chan() for readability
2026-01-09 17:35 [PATCH v3 0/3] dmaengine: A little cleanup and refactoring Andy Shevchenko
@ 2026-01-09 17:35 ` Andy Shevchenko
2026-01-09 17:35 ` [PATCH v3 2/3] dmaengine: Use device_match_of_node() helper Andy Shevchenko
` (4 subsequent siblings)
5 siblings, 0 replies; 8+ messages in thread
From: Andy Shevchenko @ 2026-01-09 17:35 UTC (permalink / raw)
To: Andy Shevchenko, dmaengine, linux-kernel; +Cc: Vinod Koul
Yes, while it's a bit longer in terms of LoCs, it's more readable
when we use the usual patter to check for errors, and not for
a success). This eliminates unneeded assignment and moves the
needed one closer to its user which is better programming pattern
because it allows avoiding potential errors in case the variable
is getting reused. Also note that the same pattern have been used
already in dmaenginem_async_device_register().
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
drivers/dma/dmaengine.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/dma/dmaengine.c b/drivers/dma/dmaengine.c
index ca13cd39330b..8fe552c74eb8 100644
--- a/drivers/dma/dmaengine.c
+++ b/drivers/dma/dmaengine.c
@@ -943,12 +943,14 @@ static void dmaenginem_release_channel(void *chan)
struct dma_chan *devm_dma_request_chan(struct device *dev, const char *name)
{
- struct dma_chan *chan = dma_request_chan(dev, name);
- int ret = 0;
+ struct dma_chan *chan;
+ int ret;
- if (!IS_ERR(chan))
- ret = devm_add_action_or_reset(dev, dmaenginem_release_channel, chan);
+ chan = dma_request_chan(dev, name);
+ if (IS_ERR(chan))
+ return chan;
+ ret = devm_add_action_or_reset(dev, dmaenginem_release_channel, chan);
if (ret)
return ERR_PTR(ret);
--
2.50.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v3 2/3] dmaengine: Use device_match_of_node() helper
2026-01-09 17:35 [PATCH v3 0/3] dmaengine: A little cleanup and refactoring Andy Shevchenko
2026-01-09 17:35 ` [PATCH v3 1/3] dmaengine: Refactor devm_dma_request_chan() for readability Andy Shevchenko
@ 2026-01-09 17:35 ` Andy Shevchenko
2026-01-09 17:35 ` [PATCH v3 3/3] dmaengine: Sort headers alphabetically Andy Shevchenko
` (3 subsequent siblings)
5 siblings, 0 replies; 8+ messages in thread
From: Andy Shevchenko @ 2026-01-09 17:35 UTC (permalink / raw)
To: Andy Shevchenko, dmaengine, linux-kernel; +Cc: Vinod Koul
Instead of open coding, use device_match_of_node() helper.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
drivers/dma/dmaengine.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/dma/dmaengine.c b/drivers/dma/dmaengine.c
index 8fe552c74eb8..ca1723a34779 100644
--- a/drivers/dma/dmaengine.c
+++ b/drivers/dma/dmaengine.c
@@ -765,7 +765,7 @@ struct dma_chan *__dma_request_channel(const dma_cap_mask_t *mask,
mutex_lock(&dma_list_mutex);
list_for_each_entry_safe(device, _d, &dma_device_list, global_node) {
/* Finds a DMA controller with matching device node */
- if (np && device->dev->of_node && np != device->dev->of_node)
+ if (np && !device_match_of_node(device->dev, np))
continue;
chan = find_candidate(device, mask, fn, fn_param);
--
2.50.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v3 3/3] dmaengine: Sort headers alphabetically
2026-01-09 17:35 [PATCH v3 0/3] dmaengine: A little cleanup and refactoring Andy Shevchenko
2026-01-09 17:35 ` [PATCH v3 1/3] dmaengine: Refactor devm_dma_request_chan() for readability Andy Shevchenko
2026-01-09 17:35 ` [PATCH v3 2/3] dmaengine: Use device_match_of_node() helper Andy Shevchenko
@ 2026-01-09 17:35 ` Andy Shevchenko
2026-01-09 21:07 ` [PATCH v3 0/3] dmaengine: A little cleanup and refactoring Dave Jiang
` (2 subsequent siblings)
5 siblings, 0 replies; 8+ messages in thread
From: Andy Shevchenko @ 2026-01-09 17:35 UTC (permalink / raw)
To: Andy Shevchenko, dmaengine, linux-kernel; +Cc: Vinod Koul
For better maintenance sort headers alphabetically.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
drivers/dma/dmaengine.c | 38 +++++++++++++++++++-------------------
1 file changed, 19 insertions(+), 19 deletions(-)
diff --git a/drivers/dma/dmaengine.c b/drivers/dma/dmaengine.c
index ca1723a34779..45af455ab2be 100644
--- a/drivers/dma/dmaengine.c
+++ b/drivers/dma/dmaengine.c
@@ -31,29 +31,29 @@
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
-#include <linux/platform_device.h>
-#include <linux/dma-mapping.h>
-#include <linux/init.h>
-#include <linux/module.h>
-#include <linux/mm.h>
-#include <linux/device.h>
-#include <linux/dmaengine.h>
-#include <linux/hardirq.h>
-#include <linux/spinlock.h>
-#include <linux/of.h>
-#include <linux/property.h>
-#include <linux/percpu.h>
-#include <linux/rcupdate.h>
-#include <linux/mutex.h>
-#include <linux/jiffies.h>
-#include <linux/rculist.h>
-#include <linux/idr.h>
-#include <linux/slab.h>
#include <linux/acpi.h>
#include <linux/acpi_dma.h>
-#include <linux/of_dma.h>
+#include <linux/device.h>
+#include <linux/dma-mapping.h>
+#include <linux/dmaengine.h>
+#include <linux/hardirq.h>
+#include <linux/idr.h>
+#include <linux/init.h>
+#include <linux/jiffies.h>
#include <linux/mempool.h>
+#include <linux/mm.h>
+#include <linux/module.h>
+#include <linux/mutex.h>
#include <linux/numa.h>
+#include <linux/of.h>
+#include <linux/of_dma.h>
+#include <linux/percpu.h>
+#include <linux/platform_device.h>
+#include <linux/property.h>
+#include <linux/rculist.h>
+#include <linux/rcupdate.h>
+#include <linux/slab.h>
+#include <linux/spinlock.h>
#include "dmaengine.h"
--
2.50.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH v3 0/3] dmaengine: A little cleanup and refactoring
2026-01-09 17:35 [PATCH v3 0/3] dmaengine: A little cleanup and refactoring Andy Shevchenko
` (2 preceding siblings ...)
2026-01-09 17:35 ` [PATCH v3 3/3] dmaengine: Sort headers alphabetically Andy Shevchenko
@ 2026-01-09 21:07 ` Dave Jiang
2026-01-12 20:23 ` Frank Li
2026-02-25 11:24 ` Vinod Koul
5 siblings, 0 replies; 8+ messages in thread
From: Dave Jiang @ 2026-01-09 21:07 UTC (permalink / raw)
To: Andy Shevchenko, dmaengine, linux-kernel; +Cc: Vinod Koul
On 1/9/26 10:35 AM, Andy Shevchenko wrote:
> This just a set of small almost ad-hoc cleanups and refactoring.
> Nothing special and nothing that changes behaviour.
>
> Changelog v3:
> - fixed checkpatch warning (mixed tabs and spaces) (Vinod)
>
> v2: 20251110085349.3414507-1-andriy.shevchenko@linux.intel.com
>
> Changelog v2:
> - dropped not very good (and not compilable) change (LKP)
>
> Andy Shevchenko (3):
> dmaengine: Refactor devm_dma_request_chan() for readability
> dmaengine: Use device_match_of_node() helper
> dmaengine: Sort headers alphabetically
>
> drivers/dma/dmaengine.c | 50 +++++++++++++++++++++--------------------
> 1 file changed, 26 insertions(+), 24 deletions(-)
>
for the series
Reviewed-by: Dave Jiang <dave.jiang@intel.com>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v3 0/3] dmaengine: A little cleanup and refactoring
2026-01-09 17:35 [PATCH v3 0/3] dmaengine: A little cleanup and refactoring Andy Shevchenko
` (3 preceding siblings ...)
2026-01-09 21:07 ` [PATCH v3 0/3] dmaengine: A little cleanup and refactoring Dave Jiang
@ 2026-01-12 20:23 ` Frank Li
2026-01-19 7:52 ` Andy Shevchenko
2026-02-25 11:24 ` Vinod Koul
5 siblings, 1 reply; 8+ messages in thread
From: Frank Li @ 2026-01-12 20:23 UTC (permalink / raw)
To: Andy Shevchenko; +Cc: dmaengine, linux-kernel, Vinod Koul
On Fri, Jan 09, 2026 at 06:35:40PM +0100, Andy Shevchenko wrote:
> This just a set of small almost ad-hoc cleanups and refactoring.
> Nothing special and nothing that changes behaviour.
>
> Changelog v3:
> - fixed checkpatch warning (mixed tabs and spaces) (Vinod)
>
> v2: 20251110085349.3414507-1-andriy.shevchenko@linux.intel.com
>
> Changelog v2:
> - dropped not very good (and not compilable) change (LKP)
>
> Andy Shevchenko (3):
> dmaengine: Refactor devm_dma_request_chan() for readability
> dmaengine: Use device_match_of_node() helper
> dmaengine: Sort headers alphabetically
Reviewed-by: Frank Li <Frank.Li@nxp.com>
>
> drivers/dma/dmaengine.c | 50 +++++++++++++++++++++--------------------
> 1 file changed, 26 insertions(+), 24 deletions(-)
>
> --
> 2.50.1
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v3 0/3] dmaengine: A little cleanup and refactoring
2026-01-12 20:23 ` Frank Li
@ 2026-01-19 7:52 ` Andy Shevchenko
0 siblings, 0 replies; 8+ messages in thread
From: Andy Shevchenko @ 2026-01-19 7:52 UTC (permalink / raw)
To: Frank Li; +Cc: dmaengine, linux-kernel, Vinod Koul
On Mon, Jan 12, 2026 at 03:23:07PM -0500, Frank Li wrote:
> On Fri, Jan 09, 2026 at 06:35:40PM +0100, Andy Shevchenko wrote:
> > This just a set of small almost ad-hoc cleanups and refactoring.
> > Nothing special and nothing that changes behaviour.
> >
> > Changelog v3:
> > - fixed checkpatch warning (mixed tabs and spaces) (Vinod)
> >
> > v2: 20251110085349.3414507-1-andriy.shevchenko@linux.intel.com
> Reviewed-by: Frank Li <Frank.Li@nxp.com>
Thank you! Vinod, since we seems will have an -rc8 this cycle, can this series
be applied now?
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v3 0/3] dmaengine: A little cleanup and refactoring
2026-01-09 17:35 [PATCH v3 0/3] dmaengine: A little cleanup and refactoring Andy Shevchenko
` (4 preceding siblings ...)
2026-01-12 20:23 ` Frank Li
@ 2026-02-25 11:24 ` Vinod Koul
5 siblings, 0 replies; 8+ messages in thread
From: Vinod Koul @ 2026-02-25 11:24 UTC (permalink / raw)
To: dmaengine, linux-kernel, Andy Shevchenko
On Fri, 09 Jan 2026 18:35:40 +0100, Andy Shevchenko wrote:
> This just a set of small almost ad-hoc cleanups and refactoring.
> Nothing special and nothing that changes behaviour.
>
> Changelog v3:
> - fixed checkpatch warning (mixed tabs and spaces) (Vinod)
>
> v2: 20251110085349.3414507-1-andriy.shevchenko@linux.intel.com
>
> [...]
Applied, thanks!
[1/3] dmaengine: Refactor devm_dma_request_chan() for readability
commit: 4dd56ef8a26190f1735de9dddb854f175adbc6cd
[2/3] dmaengine: Use device_match_of_node() helper
commit: db4709e19ba3d50ceeba9e01db373f672698ff1f
[3/3] dmaengine: Sort headers alphabetically
commit: 9a07b4bb2c6019a8c585f48ee9b87fc843840e6e
Best regards,
--
~Vinod
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2026-02-25 11:24 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-09 17:35 [PATCH v3 0/3] dmaengine: A little cleanup and refactoring Andy Shevchenko
2026-01-09 17:35 ` [PATCH v3 1/3] dmaengine: Refactor devm_dma_request_chan() for readability Andy Shevchenko
2026-01-09 17:35 ` [PATCH v3 2/3] dmaengine: Use device_match_of_node() helper Andy Shevchenko
2026-01-09 17:35 ` [PATCH v3 3/3] dmaengine: Sort headers alphabetically Andy Shevchenko
2026-01-09 21:07 ` [PATCH v3 0/3] dmaengine: A little cleanup and refactoring Dave Jiang
2026-01-12 20:23 ` Frank Li
2026-01-19 7:52 ` Andy Shevchenko
2026-02-25 11:24 ` Vinod Koul
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox