* [PATCH][next] fs/9p: remove redundant variable ret
@ 2024-11-06 15:22 Colin Ian King
2024-11-06 21:45 ` Dan Carpenter
0 siblings, 1 reply; 4+ messages in thread
From: Colin Ian King @ 2024-11-06 15:22 UTC (permalink / raw)
To: Eric Van Hensbergen, Latchesar Ionkov, Dominique Martinet,
Christian Schoenebeck, v9fs
Cc: kernel-janitors, linux-kernel
The assignments and return checks on ret are redundant. Clean up
the code by just returning the return value from the call to
v9fs_init_inode_cache.
Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
fs/9p/v9fs.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/fs/9p/v9fs.c b/fs/9p/v9fs.c
index 281a1ed03a04..ee0a374e0d9d 100644
--- a/fs/9p/v9fs.c
+++ b/fs/9p/v9fs.c
@@ -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)
--
2.39.5
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH][next] fs/9p: remove redundant variable ret
2024-11-06 15:22 [PATCH][next] fs/9p: remove redundant variable ret Colin Ian King
@ 2024-11-06 21:45 ` Dan Carpenter
2024-11-06 22:54 ` Dominique Martinet
0 siblings, 1 reply; 4+ messages in thread
From: Dan Carpenter @ 2024-11-06 21:45 UTC (permalink / raw)
To: Colin Ian King
Cc: Eric Van Hensbergen, Latchesar Ionkov, Dominique Martinet,
Christian Schoenebeck, v9fs, kernel-janitors, linux-kernel
On Wed, Nov 06, 2024 at 03:22:09PM +0000, Colin Ian King wrote:
> The assignments and return checks on ret are redundant. Clean up
> the code by just returning the return value from the call to
> v9fs_init_inode_cache.
>
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
> ---
> fs/9p/v9fs.c | 7 +------
> 1 file changed, 1 insertion(+), 6 deletions(-)
>
> diff --git a/fs/9p/v9fs.c b/fs/9p/v9fs.c
> index 281a1ed03a04..ee0a374e0d9d 100644
> --- a/fs/9p/v9fs.c
> +++ b/fs/9p/v9fs.c
> @@ -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();
> }
Better to delete the whole function and call v9fs_init_inode_cache()
directly.
regards,
dan carpenter
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH][next] fs/9p: remove redundant variable ret
2024-11-06 21:45 ` Dan Carpenter
@ 2024-11-06 22:54 ` Dominique Martinet
2024-11-07 9:14 ` Colin King (gmail)
0 siblings, 1 reply; 4+ messages in thread
From: Dominique Martinet @ 2024-11-06 22:54 UTC (permalink / raw)
To: Dan Carpenter
Cc: Colin Ian King, Eric Van Hensbergen, Latchesar Ionkov,
Christian Schoenebeck, v9fs, kernel-janitors, linux-kernel
Dan Carpenter wrote on Thu, Nov 07, 2024 at 12:45:33AM +0300:
> On Wed, Nov 06, 2024 at 03:22:09PM +0000, Colin Ian King wrote:
> > The assignments and return checks on ret are redundant. Clean up
> > the code by just returning the return value from the call to
> > v9fs_init_inode_cache.
> [...]
>
> Better to delete the whole function and call v9fs_init_inode_cache()
> directly.
Makes sense, and if we go there delete v9fs_cache_unregister as well so
the init/destroy pair properly; that also is a single function call.
Thanks!
--
Dominique Martinet | Asmadeus
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH][next] fs/9p: remove redundant variable ret
2024-11-06 22:54 ` Dominique Martinet
@ 2024-11-07 9:14 ` Colin King (gmail)
0 siblings, 0 replies; 4+ messages in thread
From: Colin King (gmail) @ 2024-11-07 9:14 UTC (permalink / raw)
To: Dominique Martinet, Dan Carpenter
Cc: Eric Van Hensbergen, Latchesar Ionkov, Christian Schoenebeck,
v9fs, kernel-janitors, linux-kernel
On 06/11/2024 22:54, Dominique Martinet wrote:
> Dan Carpenter wrote on Thu, Nov 07, 2024 at 12:45:33AM +0300:
>> On Wed, Nov 06, 2024 at 03:22:09PM +0000, Colin Ian King wrote:
>>> The assignments and return checks on ret are redundant. Clean up
>>> the code by just returning the return value from the call to
>>> v9fs_init_inode_cache.
>> [...]
>>
>> Better to delete the whole function and call v9fs_init_inode_cache()
>> directly.
>
> Makes sense, and if we go there delete v9fs_cache_unregister as well so
> the init/destroy pair properly; that also is a single function call.
>
> Thanks!
OK, will do.
Colin
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-11-07 9:14 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-06 15:22 [PATCH][next] fs/9p: remove redundant variable ret Colin Ian King
2024-11-06 21:45 ` Dan Carpenter
2024-11-06 22:54 ` Dominique Martinet
2024-11-07 9:14 ` Colin King (gmail)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox