Re: [PATCH] fs/fat: fix build warning

From: OGAWA Hirofumi
Date: Thu May 19 2011 - 19:23:13 EST


Linus Walleij <linus.walleij@xxxxxxxxxxxxxx> writes:

> From: Jonas Aberg <jonas.aberg@xxxxxxxxxxxxxx>
>
> This fixes a compile warning (unititialized variable) in
> the fat filesystem code.
>
> Signed-off-by: Jonas Aberg <jonas.aberg@xxxxxxxxxxxxxx>
> Signed-off-by: Lee Jones <lee.jones@xxxxxxxxxx>
> Signed-off-by: Linus Walleij <linus.walleij@xxxxxxxxxx>
> ---
> fs/fat/dir.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/fs/fat/dir.c b/fs/fat/dir.c
> index ee42b9e..aace9be 100644
> --- a/fs/fat/dir.c
> +++ b/fs/fat/dir.c
> @@ -1229,7 +1229,7 @@ int fat_add_entries(struct inode *dir, void *slots, int nr_slots,
> struct super_block *sb = dir->i_sb;
> struct msdos_sb_info *sbi = MSDOS_SB(sb);
> struct buffer_head *bh, *prev, *bhs[3]; /* 32*slots (672bytes) */
> - struct msdos_dir_entry *de;
> + struct msdos_dir_entry *de = NULL;
> int err, free_slots, i, nr_bhs;
> loff_t pos, i_pos;

struct msdos_dir_entry *uninitialized_var(de);

IIRC, x86 gcc doesn't warn it. Does uninitialized_var(de) make your gcc
version silent? If so, I'd like to change it like this.

Thanks.
--
OGAWA Hirofumi <hirofumi@xxxxxxxxxxxxxxxxxx>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/