diff mbox series

dmaengine: dw: dmamux: Fix build without CONFIG_OF

Message ID 20220606151713.33682-1-miquel.raynal@bootlin.com (mailing list archive)
State Changes Requested
Headers show
Series dmaengine: dw: dmamux: Fix build without CONFIG_OF | expand

Commit Message

Miquel Raynal June 6, 2022, 3:17 p.m. UTC
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(-)

Comments

Andy Shevchenko June 6, 2022, 4:14 p.m. UTC | #1
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?
diff mbox series

Patch

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" },
 	{}
 };