Patchwork [U-Boot] ARM: fix build error

login
register
mail settings
Submitter Lei Wen
Date Aug. 1, 2011, 4:05 a.m.
Message ID <1312171520-24430-1-git-send-email-leiwen@marvell.com>
Download mbox | patch
Permalink /patch/107656/
State Superseded
Headers show

Comments

Lei Wen - Aug. 1, 2011, 4:05 a.m.
error message:
/home/leiwen/reps/clones/uboot/include/asm/u-boot-arm.h:66: error:
conflicting types for 'setenv'
/home/leiwen/reps/clones/uboot/include/common.h:271: note: previous
declaration of 'setenv' was here

Since common code has change the setenv declaration method, follow
the common code to do the same change.

Signed-off-by: Lei Wen <leiwen@marvell.com>
---
 arch/arm/include/asm/u-boot-arm.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Wolfgang Denk - Aug. 1, 2011, 5:43 a.m.
Dear Lei Wen,

In message <1312171520-24430-1-git-send-email-leiwen@marvell.com> you wrote:
> error message:
> /home/leiwen/reps/clones/uboot/include/asm/u-boot-arm.h:66: error:
> conflicting types for 'setenv'
> /home/leiwen/reps/clones/uboot/include/common.h:271: note: previous
> declaration of 'setenv' was here
> 
> Since common code has change the setenv declaration method, follow
> the common code to do the same change.
> 
> Signed-off-by: Lei Wen <leiwen@marvell.com>
> ---
>  arch/arm/include/asm/u-boot-arm.h |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/arch/arm/include/asm/u-boot-arm.h b/arch/arm/include/asm/u-boot-arm.h
> index 3904027..b01a0e9 100644
> --- a/arch/arm/include/asm/u-boot-arm.h
> +++ b/arch/arm/include/asm/u-boot-arm.h
> @@ -63,7 +63,7 @@ void	setup_revision_tag (struct tag **params);
>  /* To be fixed!							*/
>  /* ------------------------------------------------------------ */
>  /* common/cmd_nvedit.c */
> -int	setenv		(char *, char *);
> +int	setenv		(const char *, const char *);

No, this is the wrong approach.  Instead of maintaining several
duplicated versions of the prototype (and even with a bogus comment
above it) whe should use a single definition only. See previously
posted patches.

Thanks anyway.

Best regards,

Wolfgang Denk

Patch

diff --git a/arch/arm/include/asm/u-boot-arm.h b/arch/arm/include/asm/u-boot-arm.h
index 3904027..b01a0e9 100644
--- a/arch/arm/include/asm/u-boot-arm.h
+++ b/arch/arm/include/asm/u-boot-arm.h
@@ -63,7 +63,7 @@  void	setup_revision_tag (struct tag **params);
 /* To be fixed!							*/
 /* ------------------------------------------------------------ */
 /* common/cmd_nvedit.c */
-int	setenv		(char *, char *);
+int	setenv		(const char *, const char *);
 
 /* cpu/.../interrupt.c */
 int	arch_interrupt_init	(void);