public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fs/fat: fix build warning
@ 2011-05-19 21:03 Linus Walleij
  2011-05-19 23:23 ` OGAWA Hirofumi
  0 siblings, 1 reply; 5+ messages in thread
From: Linus Walleij @ 2011-05-19 21:03 UTC (permalink / raw)
  To: linux-kernel, OGAWA Hirofumi; +Cc: Lee Jones, Jonas Aberg, Linus Walleij

From: Jonas Aberg <jonas.aberg@stericsson.com>

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

Signed-off-by: Jonas Aberg <jonas.aberg@stericsson.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
 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;
 
-- 
1.7.3.2


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] fs/fat: fix build warning
  2011-05-19 21:03 Linus Walleij
@ 2011-05-19 23:23 ` OGAWA Hirofumi
  0 siblings, 0 replies; 5+ messages in thread
From: OGAWA Hirofumi @ 2011-05-19 23:23 UTC (permalink / raw)
  To: Linus Walleij; +Cc: linux-kernel, Lee Jones, Jonas Aberg, Linus Walleij

Linus Walleij <linus.walleij@stericsson.com> writes:

> From: Jonas Aberg <jonas.aberg@stericsson.com>
>
> This fixes a compile warning (unititialized variable) in
> the fat filesystem code.
>
> Signed-off-by: Jonas Aberg <jonas.aberg@stericsson.com>
> Signed-off-by: Lee Jones <lee.jones@linaro.org>
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> ---
>  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@mail.parknet.co.jp>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] fs/fat: fix build warning
@ 2011-06-08 16:36 Linus Walleij
  2011-06-08 18:31 ` OGAWA Hirofumi
  0 siblings, 1 reply; 5+ messages in thread
From: Linus Walleij @ 2011-06-08 16:36 UTC (permalink / raw)
  To: linux-kernel, OGAWA Hirofumi; +Cc: Lee Jones, Jonas Aberg, Linus Walleij

From: Jonas Aberg <jonas.aberg@stericsson.com>

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

Signed-off-by: Jonas Aberg <jonas.aberg@stericsson.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] fs/fat: fix build warning
  2011-06-08 16:36 [PATCH] fs/fat: fix build warning Linus Walleij
@ 2011-06-08 18:31 ` OGAWA Hirofumi
  2011-08-09 13:26   ` Linus Walleij
  0 siblings, 1 reply; 5+ messages in thread
From: OGAWA Hirofumi @ 2011-06-08 18:31 UTC (permalink / raw)
  To: Linus Walleij; +Cc: linux-kernel, Lee Jones, Jonas Aberg, Linus Walleij

Linus Walleij <linus.walleij@stericsson.com> writes:

> From: Jonas Aberg <jonas.aberg@stericsson.com>
>
> This fixes a compile warning (unititialized variable) in
> the fat filesystem code.

Thanks. I'll apply.

> Signed-off-by: Jonas Aberg <jonas.aberg@stericsson.com>
> Signed-off-by: Lee Jones <lee.jones@linaro.org>
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> ---
> 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 <hirofumi@mail.parknet.co.jp>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] fs/fat: fix build warning
  2011-06-08 18:31 ` OGAWA Hirofumi
@ 2011-08-09 13:26   ` Linus Walleij
  0 siblings, 0 replies; 5+ messages in thread
From: Linus Walleij @ 2011-08-09 13:26 UTC (permalink / raw)
  To: OGAWA Hirofumi; +Cc: linux-kernel, Lee Jones, Jonas Aberg

2011/6/8 OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>:

> Linus Walleij <linus.walleij@stericsson.com> writes:
>
>> From: Jonas Aberg <jonas.aberg@stericsson.com>
>>
>> This fixes a compile warning (unititialized variable) in
>> the fat filesystem code.
>
> Thanks. I'll apply.

Hirofumi, I cannot see this fix in the mainline kernel as of v3.1-rc1.
Has it slipped out?

Thanks,
Linus Walleij

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-08-09 13:26 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-08 16:36 [PATCH] fs/fat: fix build warning Linus Walleij
2011-06-08 18:31 ` OGAWA Hirofumi
2011-08-09 13:26   ` Linus Walleij
  -- strict thread matches above, loose matches on Subject: below --
2011-05-19 21:03 Linus Walleij
2011-05-19 23:23 ` OGAWA Hirofumi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox