public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] autofs4: fix sparse warning in root.c
@ 2008-02-16  1:49 Harvey Harrison
  2008-02-16  2:47 ` Ian Kent
  0 siblings, 1 reply; 4+ messages in thread
From: Harvey Harrison @ 2008-02-16  1:49 UTC (permalink / raw)
  To: Ian Kent, Andrew Morton; +Cc: LKML

fs/autofs4/root.c:536:23: warning: symbol 'ino' shadows an earlier one
fs/autofs4/root.c:510:22: originally declared here

There is no need to redeclare, we are at the end of the loop and in
the next iteration of the loop, ino will be reset.

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
---
 fs/autofs4/root.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/autofs4/root.c b/fs/autofs4/root.c
index a54a946..1b43456 100644
--- a/fs/autofs4/root.c
+++ b/fs/autofs4/root.c
@@ -533,8 +533,8 @@ static struct dentry *autofs4_lookup_unhashed(struct autofs_sb_info *sbi, struct
 			goto next;
 
 		if (d_unhashed(dentry)) {
-			struct autofs_info *ino = autofs4_dentry_ino(dentry);
 			struct inode *inode = dentry->d_inode;
+			ino = autofs4_dentry_ino(dentry);
 
 			list_del_init(&ino->rehash);
 			dget(dentry);
-- 
1.5.4.1.1278.gc75be




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

* Re: [PATCH] autofs4: fix sparse warning in root.c
  2008-02-16  1:49 [PATCH] autofs4: fix sparse warning in root.c Harvey Harrison
@ 2008-02-16  2:47 ` Ian Kent
  2008-02-16  2:51   ` [PATCHv2] " Harvey Harrison
  0 siblings, 1 reply; 4+ messages in thread
From: Ian Kent @ 2008-02-16  2:47 UTC (permalink / raw)
  To: Harvey Harrison; +Cc: Andrew Morton, LKML


On Fri, 2008-02-15 at 17:49 -0800, Harvey Harrison wrote:
> fs/autofs4/root.c:536:23: warning: symbol 'ino' shadows an earlier one
> fs/autofs4/root.c:510:22: originally declared here
> 
> There is no need to redeclare, we are at the end of the loop and in
> the next iteration of the loop, ino will be reset.

Of course, this is fine.

But I like to leave a blank line between declarative and procedural
statements or no blank line at all if it looks natural, usually when
there are only a few lines of code.

Picky I know, but in this case I'd prefer moving the assignment down one
line.

> 
> Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
> ---
>  fs/autofs4/root.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/fs/autofs4/root.c b/fs/autofs4/root.c
> index a54a946..1b43456 100644
> --- a/fs/autofs4/root.c
> +++ b/fs/autofs4/root.c
> @@ -533,8 +533,8 @@ static struct dentry *autofs4_lookup_unhashed(struct autofs_sb_info *sbi, struct
>  			goto next;
>  
>  		if (d_unhashed(dentry)) {
> -			struct autofs_info *ino = autofs4_dentry_ino(dentry);
>  			struct inode *inode = dentry->d_inode;
> +			ino = autofs4_dentry_ino(dentry);
>  
>  			list_del_init(&ino->rehash);
>  			dget(dentry);


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

* Re: [PATCHv2] autofs4: fix sparse warning in root.c
  2008-02-16  2:47 ` Ian Kent
@ 2008-02-16  2:51   ` Harvey Harrison
  2008-02-16  3:23     ` Ian Kent
  0 siblings, 1 reply; 4+ messages in thread
From: Harvey Harrison @ 2008-02-16  2:51 UTC (permalink / raw)
  To: Ian Kent; +Cc: Andrew Morton, LKML

fs/autofs4/root.c:536:23: warning: symbol 'ino' shadows an earlier one
fs/autofs4/root.c:510:22: originally declared here

There is no need to redeclare, we are at the end of the loop and in
the next iteration of the loop, ino will be reset.

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
---
 fs/autofs4/root.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/autofs4/root.c b/fs/autofs4/root.c
index a54a946..aa4c5ff 100644
--- a/fs/autofs4/root.c
+++ b/fs/autofs4/root.c
@@ -533,9 +533,9 @@ static struct dentry *autofs4_lookup_unhashed(struct autofs_sb_info *sbi, struct
 			goto next;
 
 		if (d_unhashed(dentry)) {
-			struct autofs_info *ino = autofs4_dentry_ino(dentry);
 			struct inode *inode = dentry->d_inode;
 
+			ino = autofs4_dentry_ino(dentry);
 			list_del_init(&ino->rehash);
 			dget(dentry);
 			/*
-- 
1.5.4.1.1278.gc75be




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

* Re: [PATCHv2] autofs4: fix sparse warning in root.c
  2008-02-16  2:51   ` [PATCHv2] " Harvey Harrison
@ 2008-02-16  3:23     ` Ian Kent
  0 siblings, 0 replies; 4+ messages in thread
From: Ian Kent @ 2008-02-16  3:23 UTC (permalink / raw)
  To: Harvey Harrison; +Cc: Andrew Morton, LKML


On Fri, 2008-02-15 at 18:51 -0800, Harvey Harrison wrote:
> fs/autofs4/root.c:536:23: warning: symbol 'ino' shadows an earlier one
> fs/autofs4/root.c:510:22: originally declared here
> 
> There is no need to redeclare, we are at the end of the loop and in
> the next iteration of the loop, ino will be reset.
> 
> Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Acked-by: Ian Kent <raven@themaw.net>
> ---
>  fs/autofs4/root.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/fs/autofs4/root.c b/fs/autofs4/root.c
> index a54a946..aa4c5ff 100644
> --- a/fs/autofs4/root.c
> +++ b/fs/autofs4/root.c
> @@ -533,9 +533,9 @@ static struct dentry *autofs4_lookup_unhashed(struct autofs_sb_info *sbi, struct
>  			goto next;
>  
>  		if (d_unhashed(dentry)) {
> -			struct autofs_info *ino = autofs4_dentry_ino(dentry);
>  			struct inode *inode = dentry->d_inode;
>  
> +			ino = autofs4_dentry_ino(dentry);
>  			list_del_init(&ino->rehash);
>  			dget(dentry);
>  			/*


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

end of thread, other threads:[~2008-02-16  3:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-16  1:49 [PATCH] autofs4: fix sparse warning in root.c Harvey Harrison
2008-02-16  2:47 ` Ian Kent
2008-02-16  2:51   ` [PATCHv2] " Harvey Harrison
2008-02-16  3:23     ` Ian Kent

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