Skip to contentSkip to conversation

ARM: fix some trivial compiler warnings

PATCH In review Jason Chagas 2 participants 2 messages Nov 13, 2010 – Nov 15, 2010

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: fix some trivial compiler warnings

Quoted 2 lines

From acb6004dae483e61760714286a5e544c4a1d899c Mon Sep 17 00:00:00 2001

From: Jason Chagas <[email protected]>
Date: Sat, 13 Nov 2010 00:01:44 -0500
Subject: [PATCH] ARM: fix some trivial compiler warnings

arch/arm/kernel/ptrace.c: In function 'get_branch_address':
arch/arm/kernel/ptrace.c:429: warning: comparison between pointer and integer
arch/arm/kernel/ptrace.c:429: warning: comparison between pointer and integer

arch/arm/mach-mmp/mmp2.c:127: warning: 'clk_rtc' defined but not used

drivers/i2c/busses/i2c-pxa.c: In function 'i2c_pxa_probe':
drivers/i2c/busses/i2c-pxa.c:1004: warning: initialization discards qualifiers from pointer target type

---
 arch/arm/kernel/ptrace.c     |    2 +-
 arch/arm/mach-mmp/mmp2.c     |    1 -
 drivers/i2c/busses/i2c-pxa.c |    2 +-
 3 files changed, 2 insertions(+), 3 deletions(-)
arch/arm/kernel/ptrace.c +0 -0
index cf16bca..7bb9a88 100644
@@ -426,7 +426,7 @@ get_branch_address(struct task_struct *child,

unsigned long pc, unsigned long in
break;
}

- if (alt >= (void*)CONFIG_VECTORS_BASE && alt <
(void*)CONFIG_VECTORS_BASE + PAGE_SIZE)
+ if (alt >= CONFIG_VECTORS_BASE && alt < CONFIG_VECTORS_BASE +
PAGE_SIZE)
alt = get_user_reg(child, REG_LR);

return alt;

arch/arm/mach-mmp/mmp2.c +0 -1
index 7f5eb05..3028bb7 100644
@@ -124,7 +124,6 @@ static APBC_CLK(twsi3, MMP2_TWSI3, 0, 26000000);
 static APBC_CLK(twsi4, MMP2_TWSI4, 0, 26000000);
 static APBC_CLK(twsi5, MMP2_TWSI5, 0, 26000000);
 static APBC_CLK(twsi6, MMP2_TWSI6, 0, 26000000);
-static APBC_CLK(rtc, MMP2_RTC, 0, 32768);
 
 static APMU_CLK(nand, NAND, 0xbf, 100000000);
 
drivers/i2c/busses/i2c-pxa.c +0 -0
index 020ff23..c94e51b 100644
@@ -1001,7 +1001,7 @@ static int i2c_pxa_probe(struct platform_device

*dev)
struct pxa_i2c *i2c;
struct resource *res;
struct i2c_pxa_platform_data *plat = dev->dev.platform_data;
- struct platform_device_id *id = platform_get_device_id(dev);
+ const struct platform_device_id *id = platform_get_device_id(dev);
int ret;
int irq;

Signature · 1 line
1.7.2.3
#1 lore raw
Quoted 46 lines · Jason Chagas

From acb6004dae483e61760714286a5e544c4a1d899c Mon Sep 17 00:00:00 2001
From: Jason Chagas <[email protected]>
Date: Sat, 13 Nov 2010 00:01:44 -0500
Subject: [PATCH] ARM: fix some trivial compiler warnings

arch/arm/kernel/ptrace.c: In function 'get_branch_address':
arch/arm/kernel/ptrace.c:429: warning: comparison between pointer and integer
arch/arm/kernel/ptrace.c:429: warning: comparison between pointer and integer

arch/arm/mach-mmp/mmp2.c:127: warning: 'clk_rtc' defined but not used

drivers/i2c/busses/i2c-pxa.c: In function 'i2c_pxa_probe':
drivers/i2c/busses/i2c-pxa.c:1004: warning: initialization discards qualifiers from pointer target type

---

?arch/arm/kernel/ptrace.c ? ? | ? ?2 +-
?arch/arm/mach-mmp/mmp2.c ? ? | ? ?1 -
?drivers/i2c/busses/i2c-pxa.c | ? ?2 +-

?3 files changed, 2 insertions(+), 3 deletions(-)

arch/arm/kernel/ptrace.c +0 -0
index cf16bca..7bb9a88 100644
@@ -426,7 +426,7 @@ get_branch_address(struct task_struct *child,

unsigned long pc, unsigned long in
? ? ? ? ? ?break;
? ? ? ?}

- ? ? ? if (alt >= (void*)CONFIG_VECTORS_BASE && alt < (void*)CONFIG_VECTORS_BASE + PAGE_SIZE)
+ ? ? ? if (alt >= CONFIG_VECTORS_BASE && alt < CONFIG_VECTORS_BASE + PAGE_SIZE)
? ? ? ? ? ? ? ?alt = get_user_reg(child, REG_LR);

? ? ? ?return alt;

arch/arm/mach-mmp/mmp2.c +0 -0
index 7f5eb05..3028bb7 100644

arch/arm/mach-mmp/mmp2.c static APBC_CLK(twsi3, MMP2_TWSI3, 0, 26000000); · line 129

Quoted 7 lines
arch/arm/mach-mmp/mmp2.c +0 -1
@@ -124,7 +124,6 @@ static APBC_CLK(twsi3, MMP2_TWSI3, 0, 26000000);
 ?static APBC_CLK(twsi4, MMP2_TWSI4, 0, 26000000);
 ?static APBC_CLK(twsi5, MMP2_TWSI5, 0, 26000000);
 ?static APBC_CLK(twsi6, MMP2_TWSI6, 0, 26000000);
-static APBC_CLK(rtc, MMP2_RTC, 0, 32768);
 
 ?static APMU_CLK(nand, NAND, 0xbf, 100000000);
 

Jason,

I've separated this into an individual patch with comment as follows:

commit f1064ce43b6c4e6aa4d122600db2e952c79bec91

Author: Jason Chagas <[email protected]>
Date:   Mon Nov 15 09:50:12 2010 +0800

ARM: mmp2: remove not used clk_rtc

RTC clock will remain at 32KHz and powered on, there is no need for it at this moment.

arch/arm/mach-mmp/mmp2.c +0 -1
index daf3993..2e3dd08 100644
@@ -126,7 +126,6 @@ static APBC_CLK(twsi3, MMP2_TWSI3, 0, 26000000);
 static APBC_CLK(twsi4, MMP2_TWSI4, 0, 26000000);
 static APBC_CLK(twsi5, MMP2_TWSI5, 0, 26000000);
 static APBC_CLK(twsi6, MMP2_TWSI6, 0, 26000000);
-static APBC_CLK(rtc, MMP2_RTC, 0, 32768);
 
 static APMU_CLK(nand, NAND, 0xbf, 100000000);
 
Quoted 6 lines
drivers/i2c/busses/i2c-pxa.c +0 -0
index 020ff23..c94e51b 100644

drivers/i2c/busses/i2c-pxa.c static int i2c_pxa_probe(struct platform_device · line 1007

Quoted 8 lines
drivers/i2c/busses/i2c-pxa.c +1 -1
@@ -1001,7 +1001,7 @@ static int i2c_pxa_probe(struct platform_device
 *dev)
 ? ? ? ?struct pxa_i2c *i2c;
 ? ? ? ?struct resource *res;
 ? ? ? ?struct i2c_pxa_platform_data *plat = dev->dev.platform_data;
- ? ? ? struct platform_device_id *id = platform_get_device_id(dev);
+ ? ? ? const struct platform_device_id *id = platform_get_device_id(dev);
 ? ? ? ?int ret;
 ? ? ? ?int irq;

This has been fixed in the latest tree by the commit below:

commit 21e2ecfe19df8f28408b5a607fef8704f51fa7f8

Author: Marc Kleine-Budde <[email protected]>
Date:   Tue Jun 15 10:56:45 2010 +0200

i2c-pxa: fix compiler warning, due to missing const

This patch adds the missing const to "struct platform_device_id" to fix this warning:

/home/frogger/pengutronix/linux/linux-2.6/drivers/i2c/busses/i2c-pxa.c:
In function 'i2c_pxa_probe':
/home/frogger/pengutronix/linux/linux-2.6/drivers/i2c/busses/i2c-pxa.c:1004:
warning: initialization discards qualifiers from pointer target type

drivers/i2c/busses/i2c-pxa.c +1 -1
index 020ff23..c94e51b 100644
@@ -1001,7 +1001,7 @@ static int i2c_pxa_probe(struct platform_device *dev)
        struct pxa_i2c *i2c;
        struct resource *res;
        struct i2c_pxa_platform_data *plat = dev->dev.platform_data;
-       struct platform_device_id *id = platform_get_device_id(dev);
+       const struct platform_device_id *id = platform_get_device_id(dev);
        int ret;
        int irq;