All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] dmaengine: dw: dmamux: Fix build without CONFIG_OF
@ 2022-06-06 15:17 Miquel Raynal
  2022-06-06 16:14 ` Andy Shevchenko
  0 siblings, 1 reply; 2+ messages in thread
From: Miquel Raynal @ 2022-06-06 15:17 UTC (permalink / raw)
  To: Vinod Koul, dmaengine
  Cc: Andy Shevchenko, Milan Stevanovic, Jimmy Lalande,
	Pascal Eberhard, Thomas Petazzoni, Herve Codina, Clement Leger,
	Miquel Raynal, kernel test robot

When built without OF support, the match tables are not used and may
produce the following output:
>> drivers/dma/dw/rzn1-dmamux.c:105:34: warning: unused variable 'rzn1_dmac_match' [-Wunused-const-variable]
   static const struct of_device_id rzn1_dmac_match[] = {

One way to silence the warnings is to define the structures with
__maybe_unused.

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 drivers/dma/dw/rzn1-dmamux.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/dma/dw/rzn1-dmamux.c b/drivers/dma/dw/rzn1-dmamux.c
index 11d254e450b0..45aba783cfbe 100644
--- a/drivers/dma/dw/rzn1-dmamux.c
+++ b/drivers/dma/dw/rzn1-dmamux.c
@@ -102,7 +102,7 @@ static void *rzn1_dmamux_route_allocate(struct of_phandle_args *dma_spec,
 	return ERR_PTR(ret);
 }
 
-static const struct of_device_id rzn1_dmac_match[] = {
+static const struct of_device_id __maybe_unused rzn1_dmac_match[] = {
 	{ .compatible = "renesas,rzn1-dma" },
 	{}
 };
@@ -136,7 +136,7 @@ static int rzn1_dmamux_probe(struct platform_device *pdev)
 				      &dmamux->dmarouter);
 }
 
-static const struct of_device_id rzn1_dmamux_match[] = {
+static const struct of_device_id __maybe_unused rzn1_dmamux_match[] = {
 	{ .compatible = "renesas,rzn1-dmamux" },
 	{}
 };
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] dmaengine: dw: dmamux: Fix build without CONFIG_OF
  2022-06-06 15:17 [PATCH] dmaengine: dw: dmamux: Fix build without CONFIG_OF Miquel Raynal
@ 2022-06-06 16:14 ` Andy Shevchenko
  0 siblings, 0 replies; 2+ messages in thread
From: Andy Shevchenko @ 2022-06-06 16:14 UTC (permalink / raw)
  To: Miquel Raynal
  Cc: Vinod Koul, dmaengine, Milan Stevanovic, Jimmy Lalande,
	Pascal Eberhard, Thomas Petazzoni, Herve Codina, Clement Leger,
	kernel test robot

On Mon, Jun 06, 2022 at 05:17:13PM +0200, Miquel Raynal wrote:
> When built without OF support, the match tables are not used and may
> produce the following output:
> >> drivers/dma/dw/rzn1-dmamux.c:105:34: warning: unused variable 'rzn1_dmac_match' [-Wunused-const-variable]
>    static const struct of_device_id rzn1_dmac_match[] = {
> 
> One way to silence the warnings is to define the structures with
> __maybe_unused.

Can we simply drop CONFIG_OF / of_match_ptr() instead, please?

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-06-06 16:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-06 15:17 [PATCH] dmaengine: dw: dmamux: Fix build without CONFIG_OF Miquel Raynal
2022-06-06 16:14 ` Andy Shevchenko

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.