Skip to contentSkip to conversation

DMA: PL330: Fix build warning

PATCH New Boojin Kim 3 participants 3 messages Nov 3, 2011 – Nov 10, 2011

Subsystems (2)
lore
Share & tools
lore

Boojin Kim

author
#0 lore raw

PATCH 1/1 DMA: PL330: Fix build warning

This patch adds to fix the build warning as following.

drivers/dma/pl330.c: In function 'pl330_probe':
drivers/dma/pl330.c:859: warning: comparison of distinct pointer types lacks a cast

---
 drivers/dma/pl330.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/dma/pl330.c +2 -1
index 621134f..379d928 100644
@@ -856,7 +856,8 @@ pl330_probe(struct amba_device *adev, const struct amba_id *id)
 	INIT_LIST_HEAD(&pd->channels);
 
 	/* Initialize channel parameters */
-	num_chan = max(pdat ? pdat->nr_valid_peri : 0, (u8)pi->pcfg.num_chan);
+	num_chan = max(pdat ? (int)pdat->nr_valid_peri : 0,
+					(int)pi->pcfg.num_chan);
 	pdmac->peripherals = kzalloc(num_chan * sizeof(*pch), GFP_KERNEL);
 
 	for (i = 0; i < num_chan; i++) {
Signature · 1 line
1.7.1
#1 lore raw

PATCH 1/1 DMA: PL330: Fix build warning

Quoted 15 lines · Boojin Kim

This patch adds to fix the build warning as following.

drivers/dma/pl330.c: In function 'pl330_probe':
drivers/dma/pl330.c:859: warning: comparison of distinct pointer types lacks a cast

---
 drivers/dma/pl330.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/dma/pl330.c +0 -0
index 621134f..379d928 100644

drivers/dma/pl330.c pl330_probe(struct amba_device *adev, const struct amba_id *id) · line 863

Quoted 9 lines
drivers/dma/pl330.c +2 -1
@@ -856,7 +856,8 @@ pl330_probe(struct amba_device *adev, const struct amba_id *id)
 	INIT_LIST_HEAD(&pd->channels);
 
 	/* Initialize channel parameters */
-	num_chan = max(pdat ? pdat->nr_valid_peri : 0, (u8)pi->pcfg.num_chan);
+	num_chan = max(pdat ? (int)pdat->nr_valid_peri : 0,
+					(int)pi->pcfg.num_chan);
 	pdmac->peripherals = kzalloc(num_chan * sizeof(*pch), GFP_KERNEL);
 
 	for (i = 0; i < num_chan; i++) {

Applied Thanks

Signature · 1 line
~Vinod
#2 lore raw

PATCH 1/1 DMA: PL330: Fix build warning

Quoted 24 lines · Vinod Koul
Quoted 23 lines · Boojin Kim

This patch adds to fix the build warning as following.

drivers/dma/pl330.c: In function 'pl330_probe':
drivers/dma/pl330.c:859: warning: comparison of distinct pointer types lacks a cast

---
 drivers/dma/pl330.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/dma/pl330.c +2 -1
index 621134f..379d928 100644
@@ -856,7 +856,8 @@ pl330_probe(struct amba_device *adev, const struct amba_id *id)
 	INIT_LIST_HEAD(&pd->channels);
 
 	/* Initialize channel parameters */
-	num_chan = max(pdat ? pdat->nr_valid_peri : 0, (u8)pi->pcfg.num_chan);
+	num_chan = max(pdat ? (int)pdat->nr_valid_peri : 0,
+					(int)pi->pcfg.num_chan);
 	pdmac->peripherals = kzalloc(num_chan * sizeof(*pch), GFP_KERNEL);
 
Quoted 3 lines

drivers/dma/pl330.c pl330_probe(struct amba_device *adev, const struct amba_id *id) · line 863

Quoted 1 line
drivers/dma/pl330.c +0 -0
 	for (i = 0; i < num_chan; i++) {

Applied Thanks

Perhaps

	max_t(int, pdat ? pdat->nr_valid_peri : 0, pi->pcfg.num_chan);