Skip to contentSkip to conversation

omap2: fix assorted compiler warnings

PATCH Superseded Sanjeev Premi 2 participants 3 messages Jul 13, 2010 – Aug 9, 2010

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 omap2: fix assorted compiler warnings

This patch fixes these compiler warnings:

CC arch/arm/mach-omap2/mux.o
arch/arm/mach-omap2/mux.c: In function 'omap_mux_init_gpio':
arch/arm/mach-omap2/mux.c:90: warning: 'gpio_mux' may be used uninitial ized in this function

CC arch/arm/plat-omap/gpio.o
arch/arm/plat-omap/gpio.c: In function 'omap2_gpio_resume_after_idle':
arch/arm/plat-omap/gpio.c:2152: warning: 'l' may be used uninitialized in this function
arch/arm/plat-omap/gpio.c: In function 'omap2_gpio_prepare_for_idle':
arch/arm/plat-omap/gpio.c:2085: warning: 'l2' may be used uninitialized in this function
arch/arm/plat-omap/gpio.c:2085: warning: 'l1' may be used uninitialized in this function

CC arch/arm/mach-omap2/board-omap4panda.o
arch/arm/mach-omap2/board-omap4panda.c: In function 'omap4_panda_init':
arch/arm/mach-omap2/board-omap4panda.c:277: warning: unused variable 's tatus'

---
 arch/arm/mach-omap2/board-omap4panda.c |    2 --
 arch/arm/mach-omap2/mux.c              |    2 +-
 arch/arm/plat-omap/gpio.c              |    4 ++--
 3 files changed, 3 insertions(+), 5 deletions(-)
arch/arm/mach-omap2/board-omap4panda.c +0 -2
index c03d1d5..96f5bbb 100644
@@ -274,8 +274,6 @@ static int __init omap4_panda_i2c_init(void)
 }
 static void __init omap4_panda_init(void)
 {
-	int status;
-
 	omap4_panda_i2c_init();
 	omap_serial_init();
 	omap4_twl6030_hsmmc_init(mmc);
arch/arm/mach-omap2/mux.c +1 -1
index ab403b2..2ffacc1 100644
@@ -87,7 +87,7 @@ static char *omap_mux_options;
 int __init omap_mux_init_gpio(int gpio, int val)
 {
 	struct omap_mux_entry *e;
-	struct omap_mux *gpio_mux;
+	struct omap_mux *gpio_mux=NULL;
 	u16 old_mode;
 	u16 mux_mode;
 	int found = 0;
arch/arm/plat-omap/gpio.c +2 -2
index 9b7e354..831e6bc 100644
@@ -2082,7 +2082,7 @@ void omap2_gpio_prepare_for_idle(int power_state)
 
 	for (i = min; i < gpio_bank_count; i++) {
 		struct gpio_bank *bank = &gpio_bank[i];
-		u32 l1, l2;
+		u32 l1=0, l2=0;
 
 		if (bank->dbck_enable_mask)
 			clk_disable(bank->dbck);
@@ -2149,7 +2149,7 @@ void omap2_gpio_resume_after_idle(void)
 		min = 1;
 	for (i = min; i < gpio_bank_count; i++) {
 		struct gpio_bank *bank = &gpio_bank[i];
-		u32 l, gen, gen0, gen1;
+		u32 l=0, gen, gen0, gen1;
 
 		if (bank->dbck_enable_mask)
 			clk_enable(bank->dbck);
Signature · 1 line
1.6.6.1
maintainer
#1 lore raw

arch/arm/mach-omap2/mux.c static char *omap_mux_options; · line 90

Quoted 10 lines · Sanjeev Premi

This patch fixes these compiler warnings:

arch/arm/mach-omap2/mux.c +1 -1
@@ -87,7 +87,7 @@ static char *omap_mux_options;
 int __init omap_mux_init_gpio(int gpio, int val)
 {
 	struct omap_mux_entry *e;
-	struct omap_mux *gpio_mux;
+	struct omap_mux *gpio_mux=NULL;

Please use spaces around = like *gpio_mux = NULL;

Quoted 8 lines
arch/arm/mach-omap2/mux.c +0 -0
 	u16 old_mode;
 	u16 mux_mode;
 	int found = 0;
arch/arm/plat-omap/gpio.c +0 -0
index 9b7e354..831e6bc 100644

arch/arm/plat-omap/gpio.c void omap2_gpio_prepare_for_idle(int power_state) · line 2088

Quoted 8 lines
arch/arm/plat-omap/gpio.c +1 -1
@@ -2082,7 +2082,7 @@ void omap2_gpio_prepare_for_idle(int power_state)
 
 	for (i = min; i < gpio_bank_count; i++) {
 		struct gpio_bank *bank = &gpio_bank[i];
-		u32 l1, l2;
+		u32 l1=0, l2=0;
 
 		if (bank->dbck_enable_mask)
 			clk_disable(bank->dbck);

Here too.

arch/arm/plat-omap/gpio.c void omap2_gpio_resume_after_idle(void) · line 2155

Quoted 9 lines
arch/arm/plat-omap/gpio.c +1 -1
@@ -2149,7 +2149,7 @@ void omap2_gpio_resume_after_idle(void)
 		min = 1;
 	for (i = min; i < gpio_bank_count; i++) {
 		struct gpio_bank *bank = &gpio_bank[i];
-		u32 l, gen, gen0, gen1;
+		u32 l=0, gen, gen0, gen1;
 
 		if (bank->dbck_enable_mask)
 			clk_enable(bank->dbck);

And here.

Regards,

Tony

#2 lore raw
In reply to Sanjeev Premi
Quoted 6 lines

-----Original Message-----
From: Premi, Sanjeev
Sent: Tuesday, July 13, 2010 3:54 PM
To: [email protected]
Cc: Premi, Sanjeev
Subject: [PATCH] omap2: fix assorted compiler warnings

Tony,

I notice the same warnings today while building against:

commit 842849896627701e4c07441f2c7519aeec771058
Merge: 024a97d c287f2c
Author: Tony Lindgren <[email protected]>
Date: Wed Aug 4 18:33:28 2010 +0300

Is this patch in your queue?

~sanjeev

Quoted 89 lines

This patch fixes these compiler warnings:

CC arch/arm/mach-omap2/mux.o
arch/arm/mach-omap2/mux.c: In function 'omap_mux_init_gpio':
arch/arm/mach-omap2/mux.c:90: warning: 'gpio_mux' may be used uninitial
ized in this function

CC arch/arm/plat-omap/gpio.o
arch/arm/plat-omap/gpio.c: In function 'omap2_gpio_resume_after_idle':
arch/arm/plat-omap/gpio.c:2152: warning: 'l' may be used uninitialized in this function
arch/arm/plat-omap/gpio.c: In function 'omap2_gpio_prepare_for_idle':
arch/arm/plat-omap/gpio.c:2085: warning: 'l2' may be used uninitialized
in this function
arch/arm/plat-omap/gpio.c:2085: warning: 'l1' may be used uninitialized
in this function

CC arch/arm/mach-omap2/board-omap4panda.o
arch/arm/mach-omap2/board-omap4panda.c: In function 'omap4_panda_init':
arch/arm/mach-omap2/board-omap4panda.c:277: warning: unused variable 's
tatus'

---
 arch/arm/mach-omap2/board-omap4panda.c |    2 --
 arch/arm/mach-omap2/mux.c              |    2 +-
 arch/arm/plat-omap/gpio.c              |    4 ++--
 3 files changed, 3 insertions(+), 5 deletions(-)
arch/arm/mach-omap2/board-omap4panda.c +0 -2
index c03d1d5..96f5bbb 100644
@@ -274,8 +274,6 @@ static int __init omap4_panda_i2c_init(void)
 }
 static void __init omap4_panda_init(void)
 {
-	int status;
-
 	omap4_panda_i2c_init();
 	omap_serial_init();
 	omap4_twl6030_hsmmc_init(mmc);
arch/arm/mach-omap2/mux.c +1 -1
index ab403b2..2ffacc1 100644
@@ -87,7 +87,7 @@ static char *omap_mux_options;
 int __init omap_mux_init_gpio(int gpio, int val)
 {
 	struct omap_mux_entry *e;
-	struct omap_mux *gpio_mux;
+	struct omap_mux *gpio_mux=NULL;
 	u16 old_mode;
 	u16 mux_mode;
 	int found = 0;
arch/arm/plat-omap/gpio.c +1 -1
index 9b7e354..831e6bc 100644
@@ -2082,7 +2082,7 @@ void omap2_gpio_prepare_for_idle(int 
 power_state)
 
 	for (i = min; i < gpio_bank_count; i++) {
 		struct gpio_bank *bank = &gpio_bank[i];
-		u32 l1, l2;
+		u32 l1=0, l2=0;
 
 		if (bank->dbck_enable_mask)
arch/arm/plat-omap/gpio.c +1 -1
 			clk_disable(bank->dbck);
@@ -2149,7 +2149,7 @@ void omap2_gpio_resume_after_idle(void)
 		min = 1;
 	for (i = min; i < gpio_bank_count; i++) {
 		struct gpio_bank *bank = &gpio_bank[i];
-		u32 l, gen, gen0, gen1;
+		u32 l=0, gen, gen0, gen1;
 
 		if (bank->dbck_enable_mask)
 			clk_enable(bank->dbck);
Signature · 1 line
1.6.6.1