mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [patch] initialize variables in fs/isofs/namei.c
@ 2006-05-21 19:02 Ameer Armaly
  2006-05-21 19:08 ` Dave Jones
  0 siblings, 1 reply; 3+ messages in thread
From: Ameer Armaly @ 2006-05-21 19:02 UTC (permalink / raw)
  To: linux-kernel

This patch removes un-initialized variable warnings for block and offset in namei.c, which are later initialized through a call to isofs_find_entry().

diff --git a/fs/isofs/namei.c b/fs/isofs/namei.c
index e7ba0c3..e0d6531 100644
--- a/fs/isofs/namei.c
+++ b/fs/isofs/namei.c
@@ -159,7 +159,7 @@ #endif
  struct dentry *isofs_lookup(struct inode * dir, struct dentry * dentry, struct nameidata *nd)
  {
  	int found;
-	unsigned long block, offset;
+	unsigned long block = 0, offset = 0;
  	struct inode *inode;
  	struct page *page;


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

* Re: [patch] initialize variables in fs/isofs/namei.c
  2006-05-21 19:02 [patch] initialize variables in fs/isofs/namei.c Ameer Armaly
@ 2006-05-21 19:08 ` Dave Jones
  2006-05-21 19:21   ` Ameer Armaly
  0 siblings, 1 reply; 3+ messages in thread
From: Dave Jones @ 2006-05-21 19:08 UTC (permalink / raw)
  To: Ameer Armaly; +Cc: linux-kernel

On Sun, May 21, 2006 at 03:02:34PM -0400, Ameer Armaly wrote:
 > This patch removes un-initialized variable warnings for block and offset in 
 > namei.c, which are later initialized through a call to isofs_find_entry().

Which indicates the problem lies with gcc, just like with the other patches
'fixing' these warnings.

The warning is bogus.

		Dave

-- 
http://www.codemonkey.org.uk

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

* Re: [patch] initialize variables in fs/isofs/namei.c
  2006-05-21 19:08 ` Dave Jones
@ 2006-05-21 19:21   ` Ameer Armaly
  0 siblings, 0 replies; 3+ messages in thread
From: Ameer Armaly @ 2006-05-21 19:21 UTC (permalink / raw)
  To: Dave Jones; +Cc: linux-kernel



On Sun, 21 May 2006, Dave Jones wrote:

> On Sun, May 21, 2006 at 03:02:34PM -0400, Ameer Armaly wrote:
> > This patch removes un-initialized variable warnings for block and offset in
> > namei.c, which are later initialized through a call to isofs_find_entry().
>
> Which indicates the problem lies with gcc, just like with the other patches
> 'fixing' these warnings.
>
I agree.  The compiler should be smart enough to at least consider the 
possibility of initializing through pointers.
> The warning is bogus.
>
It is, but at the same it's clutter; in my opinion, readability is not 
impacted by explicitly initializing variables that get initialized through 
a pointer, and we reduce annoying make output.
  > 		Dave
>
> -- 
> http://www.codemonkey.org.uk
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
>

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

end of thread, other threads:[~2006-05-21 19:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-05-21 19:02 [patch] initialize variables in fs/isofs/namei.c Ameer Armaly
2006-05-21 19:08 ` Dave Jones
2006-05-21 19:21   ` Ameer Armaly

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

all inboxes | Powered by JetHome®