[U-Boot] [PATCH 03/13] fs/yaffs2/yaffs_guts.c: Fix GCC 4.6 compile warning (and bug)

William Juul (wiljuul) wiljuul at cisco.com
Fri Dec 9 12:36:31 CET 2011


Acked-by: William Juul <wiljuul at cisco.com>

And please note my new e-mail address.

Best regards
William Juul

> -----Original Message-----
> From: Wolfgang Denk [mailto:wd at denx.de]
> Sent: Friday, December 09, 2011 12:14 PM
> To: u-boot at lists.denx.de
> Cc: Wolfgang Denk; William Juul; Scott Wood
> Subject: [PATCH 03/13] fs/yaffs2/yaffs_guts.c: Fix GCC 4.6 compile
> warning (and bug)
> 
> Fix:
> yaffs_guts.c: In function 'yaffs_GarbageCollectBlock':
> yaffs_guts.c:2761:6: warning: variable 'retVal' set but not used
> [-Wunused-but-set-variable]
> 
> Here GCC actually detected a bug.  The code was always returning OK
> instead of the previously set retrun code.  Fix that.
> 
> Signed-off-by: Wolfgang Denk <wd at denx.de>
> Cc: William Juul <william.juul at tandberg.com>
> Cc: Scott Wood <scottwood at freescale.com>
> ---
>  fs/yaffs2/yaffs_guts.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/fs/yaffs2/yaffs_guts.c b/fs/yaffs2/yaffs_guts.c
> index f0ef8db..7390b40 100644
> --- a/fs/yaffs2/yaffs_guts.c
> +++ b/fs/yaffs2/yaffs_guts.c
> @@ -2976,7 +2976,7 @@ static int
yaffs_GarbageCollectBlock(yaffs_Device
> * dev, int block)
> 
>  	dev->isDoingGC = 0;
> 
> -	return YAFFS_OK;
> +	return retVal;
>  }
> 
>  /* New garbage collector
> --
> 1.7.6.4



More information about the U-Boot mailing list