Skip to contentSkip to conversation

xfs: remove unreachable code

PATCH Superseded Jiapeng Chong 3 participants 3 messages May 6, 2022 – May 10, 2022 XFS filesystem

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xfs: remove unreachable code

Clean up the following smatch warning:

fs/xfs/xfs_icache.c:1768 xfs_icwalk() warn: ignoring unreachable code.

---
 fs/xfs/xfs_icache.c | 1 -
 1 file changed, 1 deletion(-)
fs/xfs/xfs_icache.c +0 -1
index 5269354b1b69..5af272c20934 100644
@@ -1765,7 +1765,6 @@ xfs_icwalk(
 		}
 	}
 	return last_error;
-	BUILD_BUG_ON(XFS_ICWALK_PRIVATE_FLAGS & XFS_ICWALK_FLAGS_VALID);
 }
 
 #ifdef DEBUG
Signature · 1 line
2.20.1.7.g153144c
#1 lore raw
Quoted 15 lines · Jiapeng Chong

Clean up the following smatch warning:

fs/xfs/xfs_icache.c:1768 xfs_icwalk() warn: ignoring unreachable code.

---
 fs/xfs/xfs_icache.c | 1 -
 1 file changed, 1 deletion(-)
fs/xfs/xfs_icache.c +0 -0
index 5269354b1b69..5af272c20934 100644

fs/xfs/xfs_icache.c xfs_icwalk( · line 1768

Quoted 4 lines
fs/xfs/xfs_icache.c +0 -1
@@ -1765,7 +1765,6 @@ xfs_icwalk(
 		}
 	}
 	return last_error;
-	BUILD_BUG_ON(XFS_ICWALK_PRIVATE_FLAGS & XFS_ICWALK_FLAGS_VALID);

<cough> Do you know what you're removing?

--D

Quoted 6 lines
fs/xfs/xfs_icache.c +0 -0
 }
 
 #ifdef DEBUG
Signature · 1 line
2.20.1.7.g153144c
#2 lore raw
Quoted 7 lines · Darrick J. Wong

fs/xfs/xfs_icache.c xfs_icwalk( · line 1768

Quoted 5 lines
fs/xfs/xfs_icache.c +0 -1
@@ -1765,7 +1765,6 @@ xfs_icwalk(
 		}
 	}
 	return last_error;
-	BUILD_BUG_ON(XFS_ICWALK_PRIVATE_FLAGS & XFS_ICWALK_FLAGS_VALID);

<cough> Do you know what you're removing?

That being said hiding this behind the return is rather odd. The normal placement in most of the kernel is at the beginning of a function.