mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* Compiler warning fixes
@ 2013-10-01  6:22 Sascha Hauer
  2013-10-01  6:22 ` [PATCH 1/6] ARM: edb93xx: Add missing include Sascha Hauer
                   ` (5 more replies)
  0 siblings, 6 replies; 11+ messages in thread
From: Sascha Hauer @ 2013-10-01  6:22 UTC (permalink / raw)
  To: barebox

Some fixes for compiler warnings

----------------------------------------------------------------
Sascha Hauer (6):
      ARM: edb93xx: Add missing include
      ARM: friendlyarm-tiny210: remove unused variable
      ARM: mx23-evk: Fix result checking of devfs_add_partition
      ARM: Ka-Ro TX28: Fix result checking of devfs_add_partition
      ARM: vexpress: Fix compiler warning
      mips: bcm47xx: Fix compiler warning

 arch/arm/boards/edb93xx/edb93xx.c              | 1 +
 arch/arm/boards/freescale-mx23-evk/mx23-evk.c  | 6 +++++-
 arch/arm/boards/friendlyarm-tiny210/lowlevel.c | 2 --
 arch/arm/boards/karo-tx28/tx28-stk5.c          | 6 +++++-
 arch/arm/boards/vexpress/init.c                | 2 ++
 arch/mips/mach-bcm47xx/include/mach/debug_ll.h | 6 ++++--
 6 files changed, 17 insertions(+), 6 deletions(-)

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 1/6] ARM: edb93xx: Add missing include
  2013-10-01  6:22 Compiler warning fixes Sascha Hauer
@ 2013-10-01  6:22 ` Sascha Hauer
  2013-10-01  6:22 ` [PATCH 2/6] ARM: friendlyarm-tiny210: remove unused variable Sascha Hauer
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 11+ messages in thread
From: Sascha Hauer @ 2013-10-01  6:22 UTC (permalink / raw)
  To: barebox

Fixes:

arch/arm/boards/edb93xx/edb93xx.c: In function 'edb93xx_console_init':
arch/arm/boards/edb93xx/edb93xx.c:123:2: warning: implicit declaration of function 'free' [-Wimplicit-function-declaration]

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/boards/edb93xx/edb93xx.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/boards/edb93xx/edb93xx.c b/arch/arm/boards/edb93xx/edb93xx.c
index 27ba90a..1388590 100644
--- a/arch/arm/boards/edb93xx/edb93xx.c
+++ b/arch/arm/boards/edb93xx/edb93xx.c
@@ -24,6 +24,7 @@
 #include <partition.h>
 #include <asm/armlinux.h>
 #include <io.h>
+#include <malloc.h>
 #include <generated/mach-types.h>
 #include <mach/ep93xx-regs.h>
 #include "edb93xx.h"
-- 
1.8.4.rc3


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 2/6] ARM: friendlyarm-tiny210: remove unused variable
  2013-10-01  6:22 Compiler warning fixes Sascha Hauer
  2013-10-01  6:22 ` [PATCH 1/6] ARM: edb93xx: Add missing include Sascha Hauer
@ 2013-10-01  6:22 ` Sascha Hauer
  2013-10-01  6:22 ` [PATCH 3/6] ARM: mx23-evk: Fix result checking of devfs_add_partition Sascha Hauer
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 11+ messages in thread
From: Sascha Hauer @ 2013-10-01  6:22 UTC (permalink / raw)
  To: barebox

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/boards/friendlyarm-tiny210/lowlevel.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/arch/arm/boards/friendlyarm-tiny210/lowlevel.c b/arch/arm/boards/friendlyarm-tiny210/lowlevel.c
index 9676094..d980957 100644
--- a/arch/arm/boards/friendlyarm-tiny210/lowlevel.c
+++ b/arch/arm/boards/friendlyarm-tiny210/lowlevel.c
@@ -84,8 +84,6 @@ static __bare_init bool load_stage2(void *dest, size_t size)
 
 void __bare_init barebox_arm_reset_vector(void)
 {
-	uint32_t r;
-
 	arm_cpu_lowlevel_init();
 
 #ifdef CONFIG_S3C_PLL_INIT
-- 
1.8.4.rc3


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 3/6] ARM: mx23-evk: Fix result checking of devfs_add_partition
  2013-10-01  6:22 Compiler warning fixes Sascha Hauer
  2013-10-01  6:22 ` [PATCH 1/6] ARM: edb93xx: Add missing include Sascha Hauer
  2013-10-01  6:22 ` [PATCH 2/6] ARM: friendlyarm-tiny210: remove unused variable Sascha Hauer
@ 2013-10-01  6:22 ` Sascha Hauer
  2013-10-01  7:49   ` Uwe Kleine-König
  2013-10-01  6:22 ` [PATCH 4/6] ARM: Ka-Ro TX28: " Sascha Hauer
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 11+ messages in thread
From: Sascha Hauer @ 2013-10-01  6:22 UTC (permalink / raw)
  To: barebox

devfs_add_partition was changed to return the cdev. Fix the result
checking accordingly.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/boards/freescale-mx23-evk/mx23-evk.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/arch/arm/boards/freescale-mx23-evk/mx23-evk.c b/arch/arm/boards/freescale-mx23-evk/mx23-evk.c
index 1714fdd..9ba32d3 100644
--- a/arch/arm/boards/freescale-mx23-evk/mx23-evk.c
+++ b/arch/arm/boards/freescale-mx23-evk/mx23-evk.c
@@ -19,6 +19,7 @@
 #include <gpio.h>
 #include <environment.h>
 #include <mci.h>
+#include <linux/err.h>
 #include <asm/armlinux.h>
 #include <generated/mach-types.h>
 #include <mach/imx-regs.h>
@@ -95,8 +96,11 @@ static int register_persistant_environment(void)
 	}
 
 	/* use the full partition as our persistent environment storage */
-	return devfs_add_partition("disk0.1", 0, cdev->size,
+	cdev = devfs_add_partition("disk0.1", 0, cdev->size,
 						DEVFS_PARTITION_FIXED, "env0");
+	if (IS_ERR(cdev))
+		return PTR_ERR(cdev);
+	return 0;
 }
 
 static int mx23_evk_devices_init(void)
-- 
1.8.4.rc3


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 4/6] ARM: Ka-Ro TX28: Fix result checking of devfs_add_partition
  2013-10-01  6:22 Compiler warning fixes Sascha Hauer
                   ` (2 preceding siblings ...)
  2013-10-01  6:22 ` [PATCH 3/6] ARM: mx23-evk: Fix result checking of devfs_add_partition Sascha Hauer
@ 2013-10-01  6:22 ` Sascha Hauer
  2013-10-01  6:22 ` [PATCH 5/6] ARM: vexpress: Fix compiler warning Sascha Hauer
  2013-10-01  6:22 ` [PATCH 6/6] mips: bcm47xx: " Sascha Hauer
  5 siblings, 0 replies; 11+ messages in thread
From: Sascha Hauer @ 2013-10-01  6:22 UTC (permalink / raw)
  To: barebox

devfs_add_partition was changed to return the cdev. Fix the result
checking accordingly.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/boards/karo-tx28/tx28-stk5.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/arch/arm/boards/karo-tx28/tx28-stk5.c b/arch/arm/boards/karo-tx28/tx28-stk5.c
index 2984d10..57cb0c3 100644
--- a/arch/arm/boards/karo-tx28/tx28-stk5.c
+++ b/arch/arm/boards/karo-tx28/tx28-stk5.c
@@ -23,6 +23,7 @@
 #include <io.h>
 #include <net.h>
 #include <asm/sections.h>
+#include <linux/err.h>
 #include <mach/imx-regs.h>
 #include <mach/clock.h>
 #include <mach/mci.h>
@@ -344,8 +345,11 @@ static int register_persistent_environment(void)
 	}
 
 	/* use the full partition as our persistent environment storage */
-	return devfs_add_partition("disk0.1", 0, cdev->size,
+	cdev = devfs_add_partition("disk0.1", 0, cdev->size,
 					DEVFS_PARTITION_FIXED, "env0");
+	if (IS_ERR(cdev))
+		return PTR_ERR(cdev);
+	return 0;
 }
 
 void tx28_get_ethaddr(void)
-- 
1.8.4.rc3


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 5/6] ARM: vexpress: Fix compiler warning
  2013-10-01  6:22 Compiler warning fixes Sascha Hauer
                   ` (3 preceding siblings ...)
  2013-10-01  6:22 ` [PATCH 4/6] ARM: Ka-Ro TX28: " Sascha Hauer
@ 2013-10-01  6:22 ` Sascha Hauer
  2013-10-01 13:22   ` Jean-Christophe PLAGNIOL-VILLARD
  2013-10-01  6:22 ` [PATCH 6/6] mips: bcm47xx: " Sascha Hauer
  5 siblings, 1 reply; 11+ messages in thread
From: Sascha Hauer @ 2013-10-01  6:22 UTC (permalink / raw)
  To: barebox

Fixes:

arch/arm/boards/vexpress/init.c: In function 'vexpress_core_init':
arch/arm/boards/vexpress/init.c:139:22: warning: 'hostname' may be used uninitialized in this function [-Wmaybe-uninitialized]

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/boards/vexpress/init.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/boards/vexpress/init.c b/arch/arm/boards/vexpress/init.c
index 48bc11e..5358be3 100644
--- a/arch/arm/boards/vexpress/init.c
+++ b/arch/arm/boards/vexpress/init.c
@@ -133,6 +133,8 @@ static int vexpress_core_init(void)
 			hostname = "vexpress-a9";
 		else if (cpu_is_cortex_a15())
 			hostname = "vexpress-a15";
+		else
+			hostname = "vexpress-unknown";
 	}
 
 	barebox_set_model("ARM Vexpress");
-- 
1.8.4.rc3


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 6/6] mips: bcm47xx: Fix compiler warning
  2013-10-01  6:22 Compiler warning fixes Sascha Hauer
                   ` (4 preceding siblings ...)
  2013-10-01  6:22 ` [PATCH 5/6] ARM: vexpress: Fix compiler warning Sascha Hauer
@ 2013-10-01  6:22 ` Sascha Hauer
  5 siblings, 0 replies; 11+ messages in thread
From: Sascha Hauer @ 2013-10-01  6:22 UTC (permalink / raw)
  To: barebox

Fixes:

arch/mips/mach-bcm47xx/include/mach/debug_ll.h: In function 'PUTC_LL':
arch/mips/mach-bcm47xx/include/mach/debug_ll.h:33: warning: passing argument 1 of '__raw_readb' makes pointer from integer without a cast
arch/mips/mach-bcm47xx/include/mach/debug_ll.h:34: warning: passing argument 2 of '__raw_writeb' makes pointer from integer without a cast

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/mips/mach-bcm47xx/include/mach/debug_ll.h | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/mips/mach-bcm47xx/include/mach/debug_ll.h b/arch/mips/mach-bcm47xx/include/mach/debug_ll.h
index 0703bb0..9927b4d 100644
--- a/arch/mips/mach-bcm47xx/include/mach/debug_ll.h
+++ b/arch/mips/mach-bcm47xx/include/mach/debug_ll.h
@@ -30,8 +30,10 @@
 
 static __inline__ void PUTC_LL(char ch)
 {
-	while (!(__raw_readb(DEBUG_LL_UART_ADDR + lsr) & LSR_THRE));
-	__raw_writeb(ch, DEBUG_LL_UART_ADDR + rbr);
+	void *base = (void *)DEBUG_LL_UART_ADDR;
+
+	while (!(__raw_readb(base + lsr) & LSR_THRE));
+	__raw_writeb(ch, base + rbr);
 }
 
 #endif  /* __INCLUDE_ARCH_DEBUG_LL_H__ */
-- 
1.8.4.rc3


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 3/6] ARM: mx23-evk: Fix result checking of devfs_add_partition
  2013-10-01  6:22 ` [PATCH 3/6] ARM: mx23-evk: Fix result checking of devfs_add_partition Sascha Hauer
@ 2013-10-01  7:49   ` Uwe Kleine-König
  2013-10-02  8:29     ` Sascha Hauer
  0 siblings, 1 reply; 11+ messages in thread
From: Uwe Kleine-König @ 2013-10-01  7:49 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: barebox

Hello Sascha,

On Tue, Oct 01, 2013 at 08:22:05AM +0200, Sascha Hauer wrote:
> +	if (IS_ERR(cdev))
> +		return PTR_ERR(cdev);
> +	return 0;
In Linux you can use

	return PTR_ERR_OR_ZERO(cdev)

instead. Didn't check if barebox already has that.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 5/6] ARM: vexpress: Fix compiler warning
  2013-10-01  6:22 ` [PATCH 5/6] ARM: vexpress: Fix compiler warning Sascha Hauer
@ 2013-10-01 13:22   ` Jean-Christophe PLAGNIOL-VILLARD
  2013-10-02  8:27     ` Sascha Hauer
  0 siblings, 1 reply; 11+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2013-10-01 13:22 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: barebox

On 08:22 Tue 01 Oct     , Sascha Hauer wrote:
> Fixes:
> 
> arch/arm/boards/vexpress/init.c: In function 'vexpress_core_init':
> arch/arm/boards/vexpress/init.c:139:22: warning: 'hostname' may be used uninitialized in this function [-Wmaybe-uninitialized]
> 
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> ---
>  arch/arm/boards/vexpress/init.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/arch/arm/boards/vexpress/init.c b/arch/arm/boards/vexpress/init.c
> index 48bc11e..5358be3 100644
> --- a/arch/arm/boards/vexpress/init.c
> +++ b/arch/arm/boards/vexpress/init.c
> @@ -133,6 +133,8 @@ static int vexpress_core_init(void)
>  			hostname = "vexpress-a9";
>  		else if (cpu_is_cortex_a15())
>  			hostname = "vexpress-a15";
> +		else
> +			hostname = "vexpress-unknown";

so set hostname by default not on else
>  	}
>  
>  	barebox_set_model("ARM Vexpress");
> -- 
> 1.8.4.rc3
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 5/6] ARM: vexpress: Fix compiler warning
  2013-10-01 13:22   ` Jean-Christophe PLAGNIOL-VILLARD
@ 2013-10-02  8:27     ` Sascha Hauer
  0 siblings, 0 replies; 11+ messages in thread
From: Sascha Hauer @ 2013-10-02  8:27 UTC (permalink / raw)
  To: Jean-Christophe PLAGNIOL-VILLARD; +Cc: barebox

On Tue, Oct 01, 2013 at 03:22:50PM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote:
> On 08:22 Tue 01 Oct     , Sascha Hauer wrote:
> > Fixes:
> > 
> > arch/arm/boards/vexpress/init.c: In function 'vexpress_core_init':
> > arch/arm/boards/vexpress/init.c:139:22: warning: 'hostname' may be used uninitialized in this function [-Wmaybe-uninitialized]
> > 
> > Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> > ---
> >  arch/arm/boards/vexpress/init.c | 2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/arch/arm/boards/vexpress/init.c b/arch/arm/boards/vexpress/init.c
> > index 48bc11e..5358be3 100644
> > --- a/arch/arm/boards/vexpress/init.c
> > +++ b/arch/arm/boards/vexpress/init.c
> > @@ -133,6 +133,8 @@ static int vexpress_core_init(void)
> >  			hostname = "vexpress-a9";
> >  		else if (cpu_is_cortex_a15())
> >  			hostname = "vexpress-a15";
> > +		else
> > +			hostname = "vexpress-unknown";
> 
> so set hostname by default not on else

Ok, changed this.

Sascha

> >  	}
> >  
> >  	barebox_set_model("ARM Vexpress");
> > -- 
> > 1.8.4.rc3
> > 
> > 
> > _______________________________________________
> > barebox mailing list
> > barebox@lists.infradead.org
> > http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 3/6] ARM: mx23-evk: Fix result checking of devfs_add_partition
  2013-10-01  7:49   ` Uwe Kleine-König
@ 2013-10-02  8:29     ` Sascha Hauer
  0 siblings, 0 replies; 11+ messages in thread
From: Sascha Hauer @ 2013-10-02  8:29 UTC (permalink / raw)
  To: Uwe Kleine-König; +Cc: barebox

On Tue, Oct 01, 2013 at 09:49:47AM +0200, Uwe Kleine-König wrote:
> Hello Sascha,
> 
> On Tue, Oct 01, 2013 at 08:22:05AM +0200, Sascha Hauer wrote:
> > +	if (IS_ERR(cdev))
> > +		return PTR_ERR(cdev);
> > +	return 0;
> In Linux you can use
> 
> 	return PTR_ERR_OR_ZERO(cdev)
> 
> instead. Didn't check if barebox already has that.

I wasn't aware this exists. barebox currently doesn't have this, but it
would be nice to introduce it.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2013-10-02  8:29 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-01  6:22 Compiler warning fixes Sascha Hauer
2013-10-01  6:22 ` [PATCH 1/6] ARM: edb93xx: Add missing include Sascha Hauer
2013-10-01  6:22 ` [PATCH 2/6] ARM: friendlyarm-tiny210: remove unused variable Sascha Hauer
2013-10-01  6:22 ` [PATCH 3/6] ARM: mx23-evk: Fix result checking of devfs_add_partition Sascha Hauer
2013-10-01  7:49   ` Uwe Kleine-König
2013-10-02  8:29     ` Sascha Hauer
2013-10-01  6:22 ` [PATCH 4/6] ARM: Ka-Ro TX28: " Sascha Hauer
2013-10-01  6:22 ` [PATCH 5/6] ARM: vexpress: Fix compiler warning Sascha Hauer
2013-10-01 13:22   ` Jean-Christophe PLAGNIOL-VILLARD
2013-10-02  8:27     ` Sascha Hauer
2013-10-01  6:22 ` [PATCH 6/6] mips: bcm47xx: " Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox