[U-Boot] [PATCH] FAT: make FAT compile without VFAT

Stefano Babic sbabic at denx.de
Tue Dec 4 17:16:12 CET 2012


On 04/12/2012 14:04, Richard Genoud wrote:
> Signed-off-by: Richard Genoud <richard.genoud at gmail.com>
> ---
>  fs/fat/fat.c |    8 ++++++++
>  1 files changed, 8 insertions(+), 0 deletions(-)
> 
> diff --git a/fs/fat/fat.c b/fs/fat/fat.c
> index 393c378..defdd74 100644
> --- a/fs/fat/fat.c
> +++ b/fs/fat/fat.c
> @@ -589,7 +589,9 @@ static dir_entry *get_dentfromdir(fsdata *mydata, int startsect,
>  				  char *filename, dir_entry *retdent,
>  				  int dols)
>  {
> +#ifdef CONFIG_SUPPORT_VFAT
>  	__u16 prevcksum = 0xffff;
> +#endif

You can declare the variable __maybe_unused without adding the #ifdef

>  	__u32 curclust = START(retdent);
>  	int files = 0, dirs = 0;
>  
> @@ -828,7 +830,9 @@ do_fat_read_at(const char *filename, unsigned long pos, void *buffer,
>  	fsdata datablock;
>  	fsdata *mydata = &datablock;
>  	dir_entry *dentptr = NULL;
> +#ifdef CONFIG_SUPPORT_VFAT
>  	__u16 prevcksum = 0xffff;
> +#endif

Ditto

> +#ifdef CONFIG_SUPPORT_VFAT
>  			csum = mkcksum(dentptr->name, dentptr->ext);
> +#endif

I think this is the only place where #ifdef is necessary

Best regards,
Stefano Babic

-- 
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================


More information about the U-Boot mailing list