9p/fs: Different branch return the same value
PATCH 1/1 9p/fs: Different branch return the same value
The same code is executed when the condition ret < 0 is true or false. Remove the if branch and just return v9fs_init_inode_cache(). This does not change the semantics of the original code.
--- fs/9p/v9fs.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-)
fs/9p/v9fs.c +1 -6
@@ -661,12 +661,7 @@ static void v9fs_destroy_inode_cache(void)static int v9fs_cache_register (void ) { -int ret; - - ret =v9fs_init_inode_cache (); -if (ret <0 ) -return ret; -return ret; +return v9fs_init_inode_cache (); }static void v9fs_cache_unregister (void )
Signature · 1 line
2.17.1
Christian Schoenebeck
reviewerQuoted 8 lines · CET Rex Nie
The same code is executed when the condition ret < 0 is true or false. Remove the if branch and just return
v9fs_init_inode_cache(). This does not change the semantics of the original code.Signed-off-by Rex Nie <[email protected]>--- fs/9p/v9fs.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-)
Too late to the party: :)
https://lore.kernel.org/all/[email protected]/
But thanks!
/Christian
Le 16/11/2024 à 16:26, Rex Nie a écrit :
Quoted 17 lines
The same code is executed when the condition ret < 0 is true or false. Remove the if branch and just return
v9fs_init_inode_cache(). This does not change the semantics of the original code.Signed-off-by Rex Nie <[email protected]>--- fs/9p/v9fs.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-)fs/9p/v9fs.c +0
-0@@ -661,12 +661,7 @@ static void v9fs_destroy_inode_cache(void)static int v9fs_cache_register (void ) {
fs/9p/v9fs.c static void v9fs_destroy_inode_cache(void) · line 667
Quoted 10 lines
fs/9p/v9fs.c +1
-6-int ret; - - ret =v9fs_init_inode_cache (); -if (ret <0 ) -return ret; -return ret; +return v9fs_init_inode_cache (); }static void v9fs_cache_unregister (void )
Hi,
a similar patch has already been sent.
See [1], which is the v2 of the patch and goes one step further.
CJ
[1]: https://lore.kernel.org/linux-kernel/[email protected]/