Skip to contentSkip to conversation

xfs: remove redundant assignment to variable error

PATCH In review Colin King 4 participants 7 messages Nov 6, 2019 – Nov 7, 2019

Subsystems (2)
lore
Share & tools
lore

Colin King

author
#0 lore raw

PATCH 1/1 xfs: remove redundant assignment to variable error

From: Colin Ian King <[email protected]>

Variable error is being initialized with a value that is never read and is being re-assigned a couple of statements later on. The assignment is redundant and hence can be removed.

Addresses-Coverity: ("Unused value")

---
 fs/xfs/xfs_super.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/xfs/xfs_super.c +1 -1
index b3188ea49413..2302f67d1a18 100644
@@ -1362,7 +1362,7 @@ xfs_fc_fill_super(
 {
 	struct xfs_mount	*mp = sb->s_fs_info;
 	struct inode		*root;
-	int			flags = 0, error = -ENOMEM;
+	int			flags = 0, error;
 
 	mp->m_super = sb;
 
Signature · 1 line
2.20.1
#1 lore raw
Quoted 7 lines · Colin King

From: Colin Ian King <[email protected]>

Variable error is being initialized with a value that is never read and is being re-assigned a couple of statements later on. The assignment is redundant and hence can be removed.

Addresses-Coverity: ("Unused value")

Er... is there a coverity id that goes with this?

Patch looks fine otherwise.

--D

Quoted 21 lines
---
 fs/xfs/xfs_super.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/xfs/xfs_super.c +1 -1
index b3188ea49413..2302f67d1a18 100644
@@ -1362,7 +1362,7 @@ xfs_fc_fill_super(
 {
 	struct xfs_mount	*mp = sb->s_fs_info;
 	struct inode		*root;
-	int			flags = 0, error = -ENOMEM;
+	int			flags = 0, error;
 
 	mp->m_super = sb;
 
Signature · 1 line
2.20.1
#2 lore raw
Quoted 10 lines · Darrick J. Wong
Quoted 7 lines · Colin King

From: Colin Ian King <[email protected]>

Variable error is being initialized with a value that is never read and is being re-assigned a couple of statements later on. The assignment is redundant and hence can be removed.

Addresses-Coverity: ("Unused value")

Er... is there a coverity id that goes with this?

Unfortunately it is a private one, so it does not make sense to use it.

Quoted 26 lines

Patch looks fine otherwise.

--D

Quoted 21 lines
---
 fs/xfs/xfs_super.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/xfs/xfs_super.c +1 -1
index b3188ea49413..2302f67d1a18 100644
@@ -1362,7 +1362,7 @@ xfs_fc_fill_super(
 {
 	struct xfs_mount	*mp = sb->s_fs_info;
 	struct inode		*root;
-	int			flags = 0, error = -ENOMEM;
+	int			flags = 0, error;
 
 	mp->m_super = sb;
 
Signature · 1 line
2.20.1
#3 lore raw
Quoted 8 lines · Colin Ian King
Quoted 7 lines · Darrick J. Wong
Quoted 6 lines · Colin King

From: Colin Ian King <[email protected]>

Variable error is being initialized with a value that is never read and is being re-assigned a couple of statements later on. The assignment is redundant and hence can be removed.

Quoted 5 lines
Quoted 3 lines
Quoted 1 line

Addresses-Coverity: ("Unused value")

Er... is there a coverity id that goes with this?

Unfortunately it is a private one, so it does not make sense to use it.

If it's not in the upstream coverity scan (and AFAICT it's not), it makes no sense to reference coverity in the commit log. It's not useful to anyone IMHO.

-Eric

#4 lore raw
Quoted 11 lines · Eric Sandeen
Quoted 8 lines · Colin Ian King
Quoted 7 lines · Darrick J. Wong
Quoted 6 lines · Colin King

From: Colin Ian King <[email protected]>

Variable error is being initialized with a value that is never read and is being re-assigned a couple of statements later on. The assignment is redundant and hence can be removed.

Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
Quoted 1 line

Addresses-Coverity: ("Unused value")

Er... is there a coverity id that goes with this?

Unfortunately it is a private one, so it does not make sense to use it.

If it's not in the upstream coverity scan (and AFAICT it's not),

that's because I'm using coverity with improved tuned coverage settings and coverity scan is just set on the default low setting.

Quoted 2 lines

it makes no sense to reference coverity in the commit log. It's not useful to anyone IMHO.

It's useful for tracking which bugs are being picked up with Coverity and the kind of bug issue. I'm trying to gather stats on static analysis fixes that land in linux to help catagorize the types of issues with fixes landing upstream.

Quoted 3 lines

-Eric

#5 lore raw
Quoted 23 lines · Colin Ian King
Quoted 11 lines · Eric Sandeen
Quoted 8 lines · Colin Ian King
Quoted 7 lines · Darrick J. Wong
Quoted 6 lines · Colin King

From: Colin Ian King <[email protected]>

Variable error is being initialized with a value that is never read and is being re-assigned a couple of statements later on. The assignment is redundant and hence can be removed.

Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
Quoted 1 line

Addresses-Coverity: ("Unused value")

Er... is there a coverity id that goes with this?

Unfortunately it is a private one, so it does not make sense to use it.

If it's not in the upstream coverity scan (and AFAICT it's not),

that's because I'm using coverity with improved tuned coverage settings and coverity scan is just set on the default low setting.

Quoted 7 lines
Quoted 2 lines

it makes no sense to reference coverity in the commit log. It's not useful to anyone IMHO.

It's useful for tracking which bugs are being picked up with Coverity and the kind of bug issue. I'm trying to gather stats on static analysis fixes that land in linux to help catagorize the types of issues with fixes landing upstream.

The commit log is public.

The way you've tagged the commit really makes no sense to anyone outside of your org.

Maybe:

Reported-by Internal Coverity instance

or something would make more sense to the general public?

-Eric

#6 lore raw
In reply to Eric Sandeen
Quoted 13 lines · Eric Sandeen
Quoted 10 lines · Colin Ian King
Quoted 9 lines · Darrick J. Wong
Quoted 7 lines · Colin King

From: Colin Ian King <[email protected]>

Variable error is being initialized with a value that is never read and is being re-assigned a couple of statements later on. The assignment is redundant and hence can be removed.

Addresses-Coverity: ("Unused value")

Quoted 8 lines
Quoted 3 lines
Quoted 1 line

Er... is there a coverity id that goes with this?

Unfortunately it is a private one, so it does not make sense to use it.

If it's not in the upstream coverity scan (and AFAICT it's not), it makes no sense to reference coverity in the commit log. It's not useful to anyone IMHO.

It's sort of useful if want to see how the bug was found or if you want to count how many bugs coverity finds... I'm pretty sure I remember someone complaining that it wasn't mentioned in the commit.

regards,
dan carpenter