Patchwork [U-Boot] board/samsung/universal_c210/universal.c: Fix build warning

login
register
mail settings
Submitter Anatolij Gustschin
Date Dec. 19, 2011, 2:20 p.m.
Message ID <1324304404-24044-1-git-send-email-agust@denx.de>
Download mbox | patch
Permalink /patch/132241/
State Accepted
Delegated to: Minkyu Kang
Headers show

Comments

Anatolij Gustschin - Dec. 19, 2011, 2:20 p.m.
Fix:
universal.c: In function 's5pc210_phy_control':
universal.c:273:7: warning: 'ret' may be used uninitialized
in this function [-Wuninitialized]

Signed-off-by: Anatolij Gustschin <agust@denx.de>
Cc: Lukasz Majewski <l.majewski@samsung.com>
Cc: Minkyu Kang <mk7.kang@samsung.com>
---
 board/samsung/universal_c210/universal.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Łukasz Majewski - Dec. 19, 2011, 3 p.m.
> Fix:
> universal.c: In function 's5pc210_phy_control':
> universal.c:273:7: warning: 'ret' may be used uninitialized
> in this function [-Wuninitialized]
> 
> Signed-off-by: Anatolij Gustschin <agust@denx.de>
> Cc: Lukasz Majewski <l.majewski@samsung.com>
> Cc: Minkyu Kang <mk7.kang@samsung.com>
> ---
>  board/samsung/universal_c210/universal.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/board/samsung/universal_c210/universal.c
> b/board/samsung/universal_c210/universal.c index 8393e4f..d0ff834
> 100644 --- a/board/samsung/universal_c210/universal.c
> +++ b/board/samsung/universal_c210/universal.c
> @@ -260,7 +260,7 @@ int board_mmc_init(bd_t *bis)
>  #ifdef CONFIG_USB_GADGET
>  static int s5pc210_phy_control(int on)
>  {
> -	int ret;
> +	int ret = 0;
>  	struct pmic *p = get_pmic();
>  
>  	if (pmic_probe(p))

Hi Anatolij,

Thank you for pointing me out about the new compiler version.

I've just realized, that I'm still using:
gcc version 4.4.1 (Sourcery G++ Lite 2009q3-68)

My question is about the GCC 4.6 version.
Is it a Codesourcery (Mentor Graphisc), ptxdist Oselas Toolchain,
buildroot (uClibc), linaro, ELDK or a vanilla GCC 4.6 build from source
with custom paramters?
Anatolij Gustschin - Dec. 19, 2011, 3:18 p.m.
Hi all,

On Mon, 19 Dec 2011 16:00:21 +0100
Lukasz Majewski <l.majewski@samsung.com> wrote:
...
> > diff --git a/board/samsung/universal_c210/universal.c
> > b/board/samsung/universal_c210/universal.c index 8393e4f..d0ff834
> > 100644 --- a/board/samsung/universal_c210/universal.c
> > +++ b/board/samsung/universal_c210/universal.c
> > @@ -260,7 +260,7 @@ int board_mmc_init(bd_t *bis)
> >  #ifdef CONFIG_USB_GADGET
> >  static int s5pc210_phy_control(int on)
> >  {
> > -	int ret;
> > +	int ret = 0;
> >  	struct pmic *p = get_pmic();
> >  
> >  	if (pmic_probe(p))
> 
> Hi Anatolij,
> 
> Thank you for pointing me out about the new compiler version.
> 
> I've just realized, that I'm still using:
> gcc version 4.4.1 (Sourcery G++ Lite 2009q3-68)
> 
> My question is about the GCC 4.6 version.
> Is it a Codesourcery (Mentor Graphisc), ptxdist Oselas Toolchain,
> buildroot (uClibc), linaro, ELDK or a vanilla GCC 4.6 build from source
> with custom paramters?

I used GCC version 4.2.2 from ELDK 4.2 and GCC version 4.6.1 20110627
from ELDK 5.1 and see this warning with both.

For another patch fixing warnings for s3c_udc_otg driver I
also used same GCC versions, but I see the warnings only
with GCC 4.6.1 from ELDK 5.1.  GCC 4.2.2 from ELDK 4.2 didn't
generate any warning when building s3c_udc_otg driver.

Thanks,
Anatolij
Wolfgang Denk - Dec. 19, 2011, 3:50 p.m.
Dear Lukasz,

In message <20111219161828.7495c109@wker> Anatolij Gustschin wrote:
> 
> I used GCC version 4.2.2 from ELDK 4.2 and GCC version 4.6.1 20110627
> from ELDK 5.1 and see this warning with both.

Note: ELDK 5.1 is based on Yocto 1.1 (edison-6.0 release tag), plus
some fixes for ARM related GCC issues. See
http://www.denx.de/wiki/ELDK-5

Best regards,

Wolfgang Denk
Minkyu Kang - Dec. 20, 2011, 1:41 a.m.
Dear Remy Bohmer,

On 19 December 2011 23:20, Anatolij Gustschin <agust@denx.de> wrote:
> Fix:
> universal.c: In function 's5pc210_phy_control':
> universal.c:273:7: warning: 'ret' may be used uninitialized
> in this function [-Wuninitialized]
>
> Signed-off-by: Anatolij Gustschin <agust@denx.de>
> Cc: Lukasz Majewski <l.majewski@samsung.com>
> Cc: Minkyu Kang <mk7.kang@samsung.com>
> ---
>  board/samsung/universal_c210/universal.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/board/samsung/universal_c210/universal.c b/board/samsung/universal_c210/universal.c
> index 8393e4f..d0ff834 100644
> --- a/board/samsung/universal_c210/universal.c
> +++ b/board/samsung/universal_c210/universal.c
> @@ -260,7 +260,7 @@ int board_mmc_init(bd_t *bis)
>  #ifdef CONFIG_USB_GADGET
>  static int s5pc210_phy_control(int on)
>  {
> -       int ret;
> +       int ret = 0;
>        struct pmic *p = get_pmic();
>
>        if (pmic_probe(p))
> --
> 1.7.5.4
>

Acked-by: Minkyu Kang <mk7.kang@samsung.com>

Thanks
Minkyu Kang
Wolfgang Denk - Dec. 20, 2011, 10:19 p.m.
Dear Anatolij Gustschin,

In message <1324304404-24044-1-git-send-email-agust@denx.de> you wrote:
> Fix:
> universal.c: In function 's5pc210_phy_control':
> universal.c:273:7: warning: 'ret' may be used uninitialized
> in this function [-Wuninitialized]
> 
> Signed-off-by: Anatolij Gustschin <agust@denx.de>
> Cc: Lukasz Majewski <l.majewski@samsung.com>
> Cc: Minkyu Kang <mk7.kang@samsung.com>
> ---
>  board/samsung/universal_c210/universal.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

Patch

diff --git a/board/samsung/universal_c210/universal.c b/board/samsung/universal_c210/universal.c
index 8393e4f..d0ff834 100644
--- a/board/samsung/universal_c210/universal.c
+++ b/board/samsung/universal_c210/universal.c
@@ -260,7 +260,7 @@  int board_mmc_init(bd_t *bis)
 #ifdef CONFIG_USB_GADGET
 static int s5pc210_phy_control(int on)
 {
-	int ret;
+	int ret = 0;
 	struct pmic *p = get_pmic();
 
 	if (pmic_probe(p))