Patchwork [5/5] powerpc/83xx: Fix sparse warnings in mpc836x_mds.c

login
register
mail settings
Submitter Anton Vorontsov
Date Dec. 3, 2008, 7:27 p.m.
Message ID <20081203192752.GE13035@oksana.dev.rtsoft.ru>
Download mbox | patch
Permalink /patch/11987/
State Accepted
Commit 78c7705037ed9f107660178e17aa73f8bc4127e8
Delegated to: Kumar Gala
Headers show

Comments

Anton Vorontsov - Dec. 3, 2008, 7:27 p.m.
This patch fixes following sparse warnings:

  CHECK   mpc836x_mds.c
mpc836x_mds.c:75:12: warning: Using plain integer as NULL pointer
mpc836x_mds.c:79:13: warning: incorrect type in assignment (different address spaces)
mpc836x_mds.c:79:13:    expected unsigned char [usertype] *static [toplevel] bcsr_regs
mpc836x_mds.c:79:13:    got void [noderef] <asn:2>*
mpc836x_mds.c:105:3: warning: incorrect type in argument 1 (different address spaces)
mpc836x_mds.c:105:3:    expected unsigned char volatile [noderef] [usertype] <asn:2>*addr
mpc836x_mds.c:105:3:    got unsigned char [usertype] *
mpc836x_mds.c:105:3: warning: incorrect type in argument 1 (different address spaces)
mpc836x_mds.c:105:3:    expected unsigned char const volatile [noderef] [usertype] <asn:2>*addr
mpc836x_mds.c:105:3:    got unsigned char [usertype] *
mpc836x_mds.c:107:3: warning: incorrect type in argument 1 (different address spaces)
mpc836x_mds.c:107:3:    expected unsigned char volatile [noderef] [usertype] <asn:2>*addr
mpc836x_mds.c:107:3:    got unsigned char [usertype] *
mpc836x_mds.c:107:3: warning: incorrect type in argument 1 (different address spaces)
mpc836x_mds.c:107:3:    expected unsigned char const volatile [noderef] [usertype] <asn:2>*addr
mpc836x_mds.c:107:3:    got unsigned char [usertype] *
mpc836x_mds.c:131:11: warning: incorrect type in argument 1 (different address spaces)
mpc836x_mds.c:131:11:    expected void volatile [noderef] <asn:2>*addr
mpc836x_mds.c:131:11:    got unsigned char [usertype] *static [toplevel] bcsr_regs

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
---
 arch/powerpc/platforms/83xx/mpc836x_mds.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
Kumar Gala - Dec. 16, 2008, 6:27 p.m.
On Dec 3, 2008, at 1:27 PM, Anton Vorontsov wrote:

> This patch fixes following sparse warnings:
>
>  CHECK   mpc836x_mds.c
> mpc836x_mds.c:75:12: warning: Using plain integer as NULL pointer
> mpc836x_mds.c:79:13: warning: incorrect type in assignment  
> (different address spaces)
> mpc836x_mds.c:79:13:    expected unsigned char [usertype] *static  
> [toplevel] bcsr_regs
> mpc836x_mds.c:79:13:    got void [noderef] <asn:2>*
> mpc836x_mds.c:105:3: warning: incorrect type in argument 1  
> (different address spaces)
> mpc836x_mds.c:105:3:    expected unsigned char volatile [noderef]  
> [usertype] <asn:2>*addr
> mpc836x_mds.c:105:3:    got unsigned char [usertype] *
> mpc836x_mds.c:105:3: warning: incorrect type in argument 1  
> (different address spaces)
> mpc836x_mds.c:105:3:    expected unsigned char const volatile  
> [noderef] [usertype] <asn:2>*addr
> mpc836x_mds.c:105:3:    got unsigned char [usertype] *
> mpc836x_mds.c:107:3: warning: incorrect type in argument 1  
> (different address spaces)
> mpc836x_mds.c:107:3:    expected unsigned char volatile [noderef]  
> [usertype] <asn:2>*addr
> mpc836x_mds.c:107:3:    got unsigned char [usertype] *
> mpc836x_mds.c:107:3: warning: incorrect type in argument 1  
> (different address spaces)
> mpc836x_mds.c:107:3:    expected unsigned char const volatile  
> [noderef] [usertype] <asn:2>*addr
> mpc836x_mds.c:107:3:    got unsigned char [usertype] *
> mpc836x_mds.c:131:11: warning: incorrect type in argument 1  
> (different address spaces)
> mpc836x_mds.c:131:11:    expected void volatile [noderef] <asn:2>*addr
> mpc836x_mds.c:131:11:    got unsigned char [usertype] *static  
> [toplevel] bcsr_regs
>
> Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
> ---
> arch/powerpc/platforms/83xx/mpc836x_mds.c |    6 +++---
> 1 files changed, 3 insertions(+), 3 deletions(-)

applied to next

- k

Patch

diff --git a/arch/powerpc/platforms/83xx/mpc836x_mds.c b/arch/powerpc/platforms/83xx/mpc836x_mds.c
index fbcca19..09e9d6f 100644
--- a/arch/powerpc/platforms/83xx/mpc836x_mds.c
+++ b/arch/powerpc/platforms/83xx/mpc836x_mds.c
@@ -18,6 +18,7 @@ 
 
 #include <linux/stddef.h>
 #include <linux/kernel.h>
+#include <linux/compiler.h>
 #include <linux/init.h>
 #include <linux/errno.h>
 #include <linux/reboot.h>
@@ -56,8 +57,6 @@ 
 #define DBG(fmt...)
 #endif
 
-static u8 *bcsr_regs = NULL;
-
 /* ************************************************************************
  *
  * Setup the architecture
@@ -66,13 +65,14 @@  static u8 *bcsr_regs = NULL;
 static void __init mpc836x_mds_setup_arch(void)
 {
 	struct device_node *np;
+	u8 __iomem *bcsr_regs = NULL;
 
 	if (ppc_md.progress)
 		ppc_md.progress("mpc836x_mds_setup_arch()", 0);
 
 	/* Map BCSR area */
 	np = of_find_node_by_name(NULL, "bcsr");
-	if (np != 0) {
+	if (np) {
 		struct resource res;
 
 		of_address_to_resource(np, 0, &res);