2011-06-08 16:36:37

by Linus Walleij

[permalink] [raw]
Subject: [PATCH] fs/fat: fix build warning

From: Jonas Aberg <[email protected]>

This fixes a compile warning (unititialized variable) in
the fat filesystem code.

Signed-off-by: Jonas Aberg <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
---
v2: use uninitialized_var() macro, this is verified to work with
static code-checking tools.
---
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 4ad6473..5efbd5d 100644
--- a/fs/fat/dir.c
+++ b/fs/fat/dir.c
@@ -1231,7 +1231,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 *uninitialized_var(de);
int err, free_slots, i, nr_bhs;
loff_t pos, i_pos;

--
1.7.3.2


2011-06-08 18:31:15

by OGAWA Hirofumi

[permalink] [raw]
Subject: Re: [PATCH] fs/fat: fix build warning

Linus Walleij <[email protected]> writes:

> From: Jonas Aberg <[email protected]>
>
> This fixes a compile warning (unititialized variable) in
> the fat filesystem code.

Thanks. I'll apply.

> Signed-off-by: Jonas Aberg <[email protected]>
> Signed-off-by: Lee Jones <[email protected]>
> Signed-off-by: Linus Walleij <[email protected]>
> ---
> v2: use uninitialized_var() macro, this is verified to work with
> static code-checking tools.
> ---
> 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 4ad6473..5efbd5d 100644
> --- a/fs/fat/dir.c
> +++ b/fs/fat/dir.c
> @@ -1231,7 +1231,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 *uninitialized_var(de);
> int err, free_slots, i, nr_bhs;
> loff_t pos, i_pos;

--
OGAWA Hirofumi <[email protected]>