Skip to contentSkip to conversation

dma: tegra: add const to of_device_id.data's structure

PATCH Superseded Laxman Dewangan 4 participants 4 messages Aug 26, 2012 – Aug 28, 2012

Subsystems (3)
lore
Share & tools
lore

Laxman Dewangan

author maintainer
#0 lore raw

PATCH 1/1 dma: tegra: add const to of_device_id.data's structure

The membe "data" of structure of_device_id is changed to const
pointer. Hence initializing this with const type data.
This will fix the compilation warning like drivers/dma/tegra20-apb-dma.c:1217:9: warning: assignment discards 'const' qualifier from pointer target type [enabled by default]

This warning came after the change
---------
commit 98d7bbb9929bcc14e11ac8a55245a4f2dc174e17
Author: Uwe Kleine-König <[email protected]>
of: add const to struct *of_device_id.data
---------

---
 drivers/dma/tegra20-apb-dma.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
drivers/dma/tegra20-apb-dma.c +4 -4
index 24acd71..09a15ff 100644
@@ -201,7 +201,7 @@ struct tegra_dma {
 	struct clk			*dma_clk;
 	spinlock_t			global_lock;
 	void __iomem			*base_addr;
-	struct tegra_dma_chip_data	*chip_data;
+	const struct tegra_dma_chip_data	*chip_data;
 
 	/* Some register need to be cache before suspend */
 	u32				reg_gen;
@@ -1173,14 +1173,14 @@ static void tegra_dma_free_chan_resources(struct dma_chan *dc)
 }
 
 /* Tegra20 specific DMA controller information */
-static struct tegra_dma_chip_data tegra20_dma_chip_data = {
+static const struct tegra_dma_chip_data tegra20_dma_chip_data = {
 	.nr_channels		= 16,
 	.max_dma_count		= 1024UL * 64,
 };
 
 #if defined(CONFIG_OF)
 /* Tegra30 specific DMA controller information */
-static struct tegra_dma_chip_data tegra30_dma_chip_data = {
+static const struct tegra_dma_chip_data tegra30_dma_chip_data = {
 	.nr_channels		= 32,
 	.max_dma_count		= 1024UL * 64,
 };
@@ -1204,7 +1204,7 @@ static int __devinit tegra_dma_probe(struct platform_device *pdev)
 	struct tegra_dma *tdma;
 	int ret;
 	int i;
-	struct tegra_dma_chip_data *cdata = NULL;
+	const struct tegra_dma_chip_data *cdata = NULL;
 
 	if (pdev->dev.of_node) {
 		const struct of_device_id *match;
Signature · 1 line
1.7.1.1
Acked-by on v1 1/1
#1 lore raw
Quoted 6 lines · Laxman Dewangan

The membe "data" of structure of_device_id is changed to const
pointer. Hence initializing this with const type data.
This will fix the compilation warning like drivers/dma/tegra20-apb-dma.c:1217:9: warning: assignment discards 'const' qualifier from pointer target type [enabled by default]

Quoted 6 lines

This warning came after the change
---------
commit 98d7bbb9929bcc14e11ac8a55245a4f2dc174e17
Author: Uwe Kleine-König <[email protected]>
of: add const to struct *of_device_id.data
---------

I wonder if this should go through Uwe's branch that made similar changes for all other drivers though? Uwe now CC'd.

#2 lore raw
Quoted 14 lines · Stephen Warren
Quoted 6 lines · Laxman Dewangan

The membe "data" of structure of_device_id is changed to const
pointer. Hence initializing this with const type data.
This will fix the compilation warning like drivers/dma/tegra20-apb-dma.c:1217:9: warning: assignment discards 'const' qualifier from pointer target type [enabled by default]

Quoted 6 lines

This warning came after the change
---------
commit 98d7bbb9929bcc14e11ac8a55245a4f2dc174e17
Author: Uwe Kleine-König <[email protected]>
of: add const to struct *of_device_id.data
---------

Quoted 4 lines

I wonder if this should go through Uwe's branch that made similar changes for all other drivers though? Uwe now CC'd.

If you forward/bounce the patch to me I can include it in my branch. I wonder if I missed this warning while testing. I did test all arm defconfigs based on 3.6-rc1.

Best regards
Uwe

Signature · 2 lines
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Acked-by
#3 lore raw
In reply to Stephen Warren
Quoted 7 lines · Stephen Warren
Quoted 6 lines · Laxman Dewangan

The membe "data" of structure of_device_id is changed to const
pointer. Hence initializing this with const type data.
This will fix the compilation warning like drivers/dma/tegra20-apb-dma.c:1217:9: warning: assignment discards 'const' qualifier from pointer target type [enabled by default]

Quoted 8 lines
Quoted 6 lines

This warning came after the change
---------
commit 98d7bbb9929bcc14e11ac8a55245a4f2dc174e17
Author: Uwe Kleine-König <[email protected]>
of: add const to struct *of_device_id.data
---------

Signature · 2 lines
~Vinod Koul
Intel Corp.