Skip to contentSkip to conversation

drivers/staging/pohmelfs: fix compile warning

PATCH In review Javier Martinez Canillas 4 participants 5 messages Jun 6, 2010 – Jun 8, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drivers/staging/pohmelfs: fix compile warning

A really trivial patch to solve a warning when compiling staging/pohmelfs

---
 drivers/staging/pohmelfs/inode.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/staging/pohmelfs/inode.c +1 -1
index 643b413..20b0c68 100644
@@ -1266,7 +1266,7 @@ static void pohmelfs_put_super(struct super_block *sb)
 {
 	struct pohmelfs_sb *psb = POHMELFS_SB(sb);
 	struct pohmelfs_inode *pi;
-	unsigned int count;
+	unsigned int count = 0;
 	unsigned int in_drop_list = 0;
 	struct inode *inode, *tmp;
 
Signature · 1 line
1.7.0.4
#1 lore raw
Quoted 7 lines · Javier Martinez Canillas

A really trivial patch to solve a warning when compiling staging/pohmelfs

drivers/staging/pohmelfs/inode.c +0 -0
index 643b413..20b0c68 100644

drivers/staging/pohmelfs/inode.c static void pohmelfs_put_super(struct super_block *sb) · line 1272

Quoted 8 lines
drivers/staging/pohmelfs/inode.c +1 -1
@@ -1266,7 +1266,7 @@ static void pohmelfs_put_super(struct super_block *sb)
 {
 	struct pohmelfs_sb *psb = POHMELFS_SB(sb);
 	struct pohmelfs_inode *pi;
-	unsigned int count;
+	unsigned int count = 0;
 	unsigned int in_drop_list = 0;
 	struct inode *inode, *tmp;
 

No warning with gcc 4.4.3.
What gcc version are you using?
Perhaps you should upgrade.

#2 lore raw
In reply to Javier Martinez Canillas
Quoted 3 lines

No warning with gcc 4.4.3.
What gcc version are you using?

gcc (Ubuntu 4.4.3-4ubuntu5) 4.4.3

Quoted 2 lines

Perhaps you should upgrade.

Strange, I have a warning with last linux-next:

drivers/staging/pohmelfs/inode.c: In function ‘pohmelfs_put_super’:
drivers/staging/pohmelfs/inode.c:1269: warning: ‘count’ may be used uninitialized in this function

Best regards,

-----------------------------------------
Javier Martínez Canillas
+595 981 88 66 58

#3 lore raw
In reply to Javier Martinez Canillas

Hi,

Quoted 5 lines · Javier Martinez Canillas

Strange, I have a warning with last linux-next:

drivers/staging/pohmelfs/inode.c: In function ‘pohmelfs_put_super’:
drivers/staging/pohmelfs/inode.c:1269: warning: ‘count’ may be used uninitialized in this function

I have the same warning with a gcc version 4.5.0 20100520 (prerelease).

Signature · 1 line
Charles Clément
#4 lore raw
In reply to Javier Martinez Canillas

Hi Javier.

Patch looks good, thank you.

Quoted 3 lines · Javier Martinez Canillas

A really trivial patch to solve a warning when compiling staging/pohmelfs

Greg, please apply.

Quoted 21 lines
---
 drivers/staging/pohmelfs/inode.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/staging/pohmelfs/inode.c +1 -1
index 643b413..20b0c68 100644
@@ -1266,7 +1266,7 @@ static void pohmelfs_put_super(struct super_block *sb)
 {
 	struct pohmelfs_sb *psb = POHMELFS_SB(sb);
 	struct pohmelfs_inode *pi;
-	unsigned int count;
+	unsigned int count = 0;
 	unsigned int in_drop_list = 0;
 	struct inode *inode, *tmp;
 
Signature · 1 line
1.7.0.4
Signature · 1 line
	Evgeniy Polyakov