Patchwork [U-Boot] arch/powerpc/cpu/mpc8xxx/ddr/interactive.c: Fix GCC 4.6 build warning

login
register
mail settings
Submitter Kumar Gala
Date Nov. 23, 2011, 4:03 p.m.
Message ID <1322064239-25437-1-git-send-email-galak@kernel.crashing.org>
Download mbox | patch
Permalink /patch/127337/
State Accepted
Commit 411e150375de1ab15029bc82fa9af8a4bfb51383
Delegated to: Marek Vasut
Headers show

Comments

Kumar Gala - Nov. 23, 2011, 4:03 p.m.
Fix:

interactive.c: In function 'fsl_ddr_interactive':
interactive.c:1357:15: warning: variable 'len' set but not used [-Wunused-but-set-variable]

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
---
 arch/powerpc/cpu/mpc8xxx/ddr/interactive.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
Marek Vasut - Nov. 24, 2011, 5:16 p.m.
> Fix:
> 
> interactive.c: In function 'fsl_ddr_interactive':
> interactive.c:1357:15: warning: variable 'len' set but not used
> [-Wunused-but-set-variable]
> 
> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
> ---
>  arch/powerpc/cpu/mpc8xxx/ddr/interactive.c |    3 +--
>  1 files changed, 1 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/powerpc/cpu/mpc8xxx/ddr/interactive.c
> b/arch/powerpc/cpu/mpc8xxx/ddr/interactive.c index d7d66ef..5b72437 100644
> --- a/arch/powerpc/cpu/mpc8xxx/ddr/interactive.c
> +++ b/arch/powerpc/cpu/mpc8xxx/ddr/interactive.c
> @@ -1354,7 +1354,6 @@ unsigned long long fsl_ddr_interactive(fsl_ddr_info_t
> *pinfo) {
>  	unsigned long long ddrsize;
>  	const char *prompt = "FSL DDR>";
> -	unsigned int len;
>  	char buffer[CONFIG_SYS_CBSIZE];
>  	char *argv[CONFIG_SYS_MAXARGS + 1];	/* NULL terminated */
>  	int argc;
> @@ -1389,7 +1388,7 @@ unsigned long long fsl_ddr_interactive(fsl_ddr_info_t
> *pinfo) * No need to worry for buffer overflow here in
>  		 * this function;  readline() maxes out at CFG_CBSIZE
>  		 */
> -		len = readline_into_buffer(prompt,  buffer);
> +		readline_into_buffer(prompt,  buffer);
>  		argc = parse_line(buffer, argv);
>  		if (argc == 0)
>  			continue;

Ok, I'll pick this one.
Marek Vasut - Nov. 24, 2011, 5:30 p.m.
> > Fix:
> > 
> > interactive.c: In function 'fsl_ddr_interactive':
> > interactive.c:1357:15: warning: variable 'len' set but not used
> > [-Wunused-but-set-variable]
> > 
> > Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
> > ---
> > 
> >  arch/powerpc/cpu/mpc8xxx/ddr/interactive.c |    3 +--
> >  1 files changed, 1 insertions(+), 2 deletions(-)
> > 
> > diff --git a/arch/powerpc/cpu/mpc8xxx/ddr/interactive.c
> > b/arch/powerpc/cpu/mpc8xxx/ddr/interactive.c index d7d66ef..5b72437
> > 100644 --- a/arch/powerpc/cpu/mpc8xxx/ddr/interactive.c
> > +++ b/arch/powerpc/cpu/mpc8xxx/ddr/interactive.c
> > @@ -1354,7 +1354,6 @@ unsigned long long
> > fsl_ddr_interactive(fsl_ddr_info_t *pinfo) {
> > 
> >  	unsigned long long ddrsize;
> >  	const char *prompt = "FSL DDR>";
> > 
> > -	unsigned int len;
> > 
> >  	char buffer[CONFIG_SYS_CBSIZE];
> >  	char *argv[CONFIG_SYS_MAXARGS + 1];	/* NULL terminated */
> >  	int argc;
> > 
> > @@ -1389,7 +1388,7 @@ unsigned long long
> > fsl_ddr_interactive(fsl_ddr_info_t *pinfo) * No need to worry for buffer
> > overflow here in
> > 
> >  		 * this function;  readline() maxes out at CFG_CBSIZE
> >  		 */
> > 
> > -		len = readline_into_buffer(prompt,  buffer);
> > +		readline_into_buffer(prompt,  buffer);
> > 
> >  		argc = parse_line(buffer, argv);
> >  		if (argc == 0)
> >  		
> >  			continue;
> 
> Ok, I'll pick this one.

Picked to:
u-boot-staging.git / marek.vasut@gmail.com

Patch

diff --git a/arch/powerpc/cpu/mpc8xxx/ddr/interactive.c b/arch/powerpc/cpu/mpc8xxx/ddr/interactive.c
index d7d66ef..5b72437 100644
--- a/arch/powerpc/cpu/mpc8xxx/ddr/interactive.c
+++ b/arch/powerpc/cpu/mpc8xxx/ddr/interactive.c
@@ -1354,7 +1354,6 @@  unsigned long long fsl_ddr_interactive(fsl_ddr_info_t *pinfo)
 {
 	unsigned long long ddrsize;
 	const char *prompt = "FSL DDR>";
-	unsigned int len;
 	char buffer[CONFIG_SYS_CBSIZE];
 	char *argv[CONFIG_SYS_MAXARGS + 1];	/* NULL terminated */
 	int argc;
@@ -1389,7 +1388,7 @@  unsigned long long fsl_ddr_interactive(fsl_ddr_info_t *pinfo)
 		 * No need to worry for buffer overflow here in
 		 * this function;  readline() maxes out at CFG_CBSIZE
 		 */
-		len = readline_into_buffer(prompt,  buffer);
+		readline_into_buffer(prompt,  buffer);
 		argc = parse_line(buffer, argv);
 		if (argc == 0)
 			continue;