* [PATCH 0/3] dmaengine: Miscellaneous cleanups
@ 2020-01-17 15:29 Geert Uytterhoeven
2020-01-17 15:29 ` [PATCH 1/3] dmaengine: Remove dma_device_satisfies_mask() wrapper Geert Uytterhoeven
` (4 more replies)
0 siblings, 5 replies; 7+ messages in thread
From: Geert Uytterhoeven @ 2020-01-17 15:29 UTC (permalink / raw)
To: Vinod Koul, Dan Williams
Cc: Lars-Peter Clausen, Matt Porter, Arnd Bergmann, dmaengine,
linux-kernel, Geert Uytterhoeven
Hi all,
This patch series contains a few miscellaneous cleanups for the DMA
engine code and API.
Thanks for your comments!
Geert Uytterhoeven (3):
dmaengine: Remove dma_device_satisfies_mask() wrapper
dmaengine: Remove dma_request_slave_channel_compat() wrapper
dmaengine: Move dma_get_{,any_}slave_channel() to private dmaengine.h
drivers/dma/dmaengine.c | 9 +++------
drivers/dma/dmaengine.h | 3 +++
drivers/dma/of-dma.c | 2 ++
include/linux/dmaengine.h | 8 ++------
4 files changed, 10 insertions(+), 12 deletions(-)
--
2.17.1
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 1/3] dmaengine: Remove dma_device_satisfies_mask() wrapper
2020-01-17 15:29 [PATCH 0/3] dmaengine: Miscellaneous cleanups Geert Uytterhoeven
@ 2020-01-17 15:29 ` Geert Uytterhoeven
2020-01-17 15:29 ` [PATCH 2/3] dmaengine: Remove dma_request_slave_channel_compat() wrapper Geert Uytterhoeven
` (3 subsequent siblings)
4 siblings, 0 replies; 7+ messages in thread
From: Geert Uytterhoeven @ 2020-01-17 15:29 UTC (permalink / raw)
To: Vinod Koul, Dan Williams
Cc: Lars-Peter Clausen, Matt Porter, Arnd Bergmann, dmaengine,
linux-kernel, Geert Uytterhoeven
Commit aa1e6f1a385eb2b0 ("dmaengine: kill struct dma_client and
supporting infrastructure") removed the last user of the
dma_device_satisfies_mask() wrapper.
Remove the wrapper, and rename __dma_device_satisfies_mask() to
dma_device_satisfies_mask(), to get rid of one more function starting
with a double underscore.
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
drivers/dma/dmaengine.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/drivers/dma/dmaengine.c b/drivers/dma/dmaengine.c
index 4ac77456e8300828..56a8420c388679d3 100644
--- a/drivers/dma/dmaengine.c
+++ b/drivers/dma/dmaengine.c
@@ -308,11 +308,8 @@ static void dma_channel_rebalance(void)
}
}
-#define dma_device_satisfies_mask(device, mask) \
- __dma_device_satisfies_mask((device), &(mask))
-static int
-__dma_device_satisfies_mask(struct dma_device *device,
- const dma_cap_mask_t *want)
+static int dma_device_satisfies_mask(struct dma_device *device,
+ const dma_cap_mask_t *want)
{
dma_cap_mask_t has;
@@ -531,7 +528,7 @@ static struct dma_chan *private_candidate(const dma_cap_mask_t *mask,
{
struct dma_chan *chan;
- if (mask && !__dma_device_satisfies_mask(dev, mask)) {
+ if (mask && !dma_device_satisfies_mask(dev, mask)) {
dev_dbg(dev->dev, "%s: wrong capabilities\n", __func__);
return NULL;
}
--
2.17.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 2/3] dmaengine: Remove dma_request_slave_channel_compat() wrapper
2020-01-17 15:29 [PATCH 0/3] dmaengine: Miscellaneous cleanups Geert Uytterhoeven
2020-01-17 15:29 ` [PATCH 1/3] dmaengine: Remove dma_device_satisfies_mask() wrapper Geert Uytterhoeven
@ 2020-01-17 15:29 ` Geert Uytterhoeven
2020-01-17 15:29 ` [PATCH 3/3] dmaengine: Move dma_get_{,any_}slave_channel() to private dmaengine.h Geert Uytterhoeven
` (2 subsequent siblings)
4 siblings, 0 replies; 7+ messages in thread
From: Geert Uytterhoeven @ 2020-01-17 15:29 UTC (permalink / raw)
To: Vinod Koul, Dan Williams
Cc: Lars-Peter Clausen, Matt Porter, Arnd Bergmann, dmaengine,
linux-kernel, Geert Uytterhoeven
At its original introduction, dma_request_slave_channel_compat() used a
wrapper, to accommodate filter functions that modify the mask passed.
Filter functions can no longer modify masks, and the mask parameter was
made const in commit a53e28da574a40bc ("dma: Make the 'mask' parameter
of __dma_request_channel const") consecutively.
Hence remove the wrapper, and rename __dma_request_slave_channel_compat()
to dma_request_slave_channel_compat(), to get rid of one more function
name starting with a double underscore.
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
include/linux/dmaengine.h | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
index 0e486bb224c5e6ce..8318645ddc1289c9 100644
--- a/include/linux/dmaengine.h
+++ b/include/linux/dmaengine.h
@@ -1415,11 +1415,9 @@ struct dma_chan *dma_get_slave_channel(struct dma_chan *chan);
struct dma_chan *dma_get_any_slave_channel(struct dma_device *device);
#define dma_request_channel(mask, x, y) \
__dma_request_channel(&(mask), x, y, NULL)
-#define dma_request_slave_channel_compat(mask, x, y, dev, name) \
- __dma_request_slave_channel_compat(&(mask), x, y, dev, name)
static inline struct dma_chan
-*__dma_request_slave_channel_compat(const dma_cap_mask_t *mask,
+*dma_request_slave_channel_compat(const dma_cap_mask_t mask,
dma_filter_fn fn, void *fn_param,
struct device *dev, const char *name)
{
@@ -1432,6 +1430,6 @@ static inline struct dma_chan
if (!fn || !fn_param)
return NULL;
- return __dma_request_channel(mask, fn, fn_param, NULL);
+ return __dma_request_channel(&mask, fn, fn_param, NULL);
}
#endif /* DMAENGINE_H */
--
2.17.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 3/3] dmaengine: Move dma_get_{,any_}slave_channel() to private dmaengine.h
2020-01-17 15:29 [PATCH 0/3] dmaengine: Miscellaneous cleanups Geert Uytterhoeven
2020-01-17 15:29 ` [PATCH 1/3] dmaengine: Remove dma_device_satisfies_mask() wrapper Geert Uytterhoeven
2020-01-17 15:29 ` [PATCH 2/3] dmaengine: Remove dma_request_slave_channel_compat() wrapper Geert Uytterhoeven
@ 2020-01-17 15:29 ` Geert Uytterhoeven
2020-01-17 15:49 ` [PATCH 0/3] dmaengine: Miscellaneous cleanups Arnd Bergmann
2020-01-21 9:23 ` Vinod Koul
4 siblings, 0 replies; 7+ messages in thread
From: Geert Uytterhoeven @ 2020-01-17 15:29 UTC (permalink / raw)
To: Vinod Koul, Dan Williams
Cc: Lars-Peter Clausen, Matt Porter, Arnd Bergmann, dmaengine,
linux-kernel, Geert Uytterhoeven
The functions dma_get_slave_channel() and dma_get_any_slave_channel()
are called from DMA engine drivers only. Hence move their declarations
from the public header file <linux/dmaengine.h> to the private header
file drivers/dma/dmaengine.h.
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
drivers/dma/dmaengine.h | 3 +++
drivers/dma/of-dma.c | 2 ++
include/linux/dmaengine.h | 2 --
3 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/dma/dmaengine.h b/drivers/dma/dmaengine.h
index 501c0b063f852d9a..488c8a5cbd3b1a4a 100644
--- a/drivers/dma/dmaengine.h
+++ b/drivers/dma/dmaengine.h
@@ -171,4 +171,7 @@ dmaengine_desc_callback_valid(struct dmaengine_desc_callback *cb)
return (cb->callback) ? true : false;
}
+struct dma_chan *dma_get_slave_channel(struct dma_chan *chan);
+struct dma_chan *dma_get_any_slave_channel(struct dma_device *device);
+
#endif
diff --git a/drivers/dma/of-dma.c b/drivers/dma/of-dma.c
index c2d779daa4b51ac8..b2c2b5e8093cf0d7 100644
--- a/drivers/dma/of-dma.c
+++ b/drivers/dma/of-dma.c
@@ -15,6 +15,8 @@
#include <linux/of.h>
#include <linux/of_dma.h>
+#include "dmaengine.h"
+
static LIST_HEAD(of_dma_list);
static DEFINE_MUTEX(of_dma_lock);
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
index 8318645ddc1289c9..2cd1d6d7ef0fcce5 100644
--- a/include/linux/dmaengine.h
+++ b/include/linux/dmaengine.h
@@ -1411,8 +1411,6 @@ int dma_async_device_register(struct dma_device *device);
int dmaenginem_async_device_register(struct dma_device *device);
void dma_async_device_unregister(struct dma_device *device);
void dma_run_dependencies(struct dma_async_tx_descriptor *tx);
-struct dma_chan *dma_get_slave_channel(struct dma_chan *chan);
-struct dma_chan *dma_get_any_slave_channel(struct dma_device *device);
#define dma_request_channel(mask, x, y) \
__dma_request_channel(&(mask), x, y, NULL)
--
2.17.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 0/3] dmaengine: Miscellaneous cleanups
2020-01-17 15:29 [PATCH 0/3] dmaengine: Miscellaneous cleanups Geert Uytterhoeven
` (2 preceding siblings ...)
2020-01-17 15:29 ` [PATCH 3/3] dmaengine: Move dma_get_{,any_}slave_channel() to private dmaengine.h Geert Uytterhoeven
@ 2020-01-17 15:49 ` Arnd Bergmann
2020-01-21 9:23 ` Vinod Koul
4 siblings, 0 replies; 7+ messages in thread
From: Arnd Bergmann @ 2020-01-17 15:49 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Vinod Koul, Dan Williams, Lars-Peter Clausen, Matt Porter,
dmaengine, linux-kernel
On Fri, Jan 17, 2020 at 4:29 PM Geert Uytterhoeven
<geert+renesas@glider.be> wrote:
>
> Hi all,
>
> This patch series contains a few miscellaneous cleanups for the DMA
> engine code and API.
>
> Thanks for your comments!
>
> Geert Uytterhoeven (3):
> dmaengine: Remove dma_device_satisfies_mask() wrapper
> dmaengine: Remove dma_request_slave_channel_compat() wrapper
> dmaengine: Move dma_get_{,any_}slave_channel() to private dmaengine.h
These all look good to me,
Acked-by: Arnd Bergmann <arnd@arndb.de>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 0/3] dmaengine: Miscellaneous cleanups
2020-01-17 15:29 [PATCH 0/3] dmaengine: Miscellaneous cleanups Geert Uytterhoeven
` (3 preceding siblings ...)
2020-01-17 15:49 ` [PATCH 0/3] dmaengine: Miscellaneous cleanups Arnd Bergmann
@ 2020-01-21 9:23 ` Vinod Koul
2020-01-21 9:33 ` Geert Uytterhoeven
4 siblings, 1 reply; 7+ messages in thread
From: Vinod Koul @ 2020-01-21 9:23 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Dan Williams, Lars-Peter Clausen, Matt Porter, Arnd Bergmann,
dmaengine, linux-kernel
On 17-01-20, 16:29, Geert Uytterhoeven wrote:
> Hi all,
>
> This patch series contains a few miscellaneous cleanups for the DMA
> engine code and API.
This looks good, thanks for the cleanup. But it fails to apply, can you
please rebase and resend
Thanks
--
~Vinod
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 0/3] dmaengine: Miscellaneous cleanups
2020-01-21 9:23 ` Vinod Koul
@ 2020-01-21 9:33 ` Geert Uytterhoeven
0 siblings, 0 replies; 7+ messages in thread
From: Geert Uytterhoeven @ 2020-01-21 9:33 UTC (permalink / raw)
To: Vinod Koul
Cc: Dan Williams, Lars-Peter Clausen, Matt Porter, Arnd Bergmann,
dmaengine, Linux Kernel Mailing List
Hi Vinod,
On Tue, Jan 21, 2020 at 10:23 AM Vinod Koul <vkoul@kernel.org> wrote:
> On 17-01-20, 16:29, Geert Uytterhoeven wrote:
> > This patch series contains a few miscellaneous cleanups for the DMA
> > engine code and API.
>
> This looks good, thanks for the cleanup. But it fails to apply, can you
> please rebase and resend
Done.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2020-01-21 9:33 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-17 15:29 [PATCH 0/3] dmaengine: Miscellaneous cleanups Geert Uytterhoeven
2020-01-17 15:29 ` [PATCH 1/3] dmaengine: Remove dma_device_satisfies_mask() wrapper Geert Uytterhoeven
2020-01-17 15:29 ` [PATCH 2/3] dmaengine: Remove dma_request_slave_channel_compat() wrapper Geert Uytterhoeven
2020-01-17 15:29 ` [PATCH 3/3] dmaengine: Move dma_get_{,any_}slave_channel() to private dmaengine.h Geert Uytterhoeven
2020-01-17 15:49 ` [PATCH 0/3] dmaengine: Miscellaneous cleanups Arnd Bergmann
2020-01-21 9:23 ` Vinod Koul
2020-01-21 9:33 ` Geert Uytterhoeven
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).