lkml.org 
[lkml]   [2020]   [Aug]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH] ceph: remove unnecessary return in switch statement
Date
From: Luis Henriques
> Sent: 14 August 2020 10:38
>
> Since there's a return immediately after the 'break', there's no need for
> this extra 'return' in the S_IFDIR case.
>
> Signed-off-by: Luis Henriques <lhenriques@suse.de>
> ---
> fs/ceph/file.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/fs/ceph/file.c b/fs/ceph/file.c
> index d51c3f2fdca0..04ab99c0223a 100644
> --- a/fs/ceph/file.c
> +++ b/fs/ceph/file.c
> @@ -256,8 +256,6 @@ static int ceph_init_file(struct inode *inode, struct file *file, int fmode)
> case S_IFDIR:
> ret = ceph_init_file_info(inode, file, fmode,
> S_ISDIR(inode->i_mode));
> - if (ret)
> - return ret;
> break;
>
> case S_IFLNK:

I'd move the other way and just do:
return ceph_init_file_info(...);

David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)

\
 
 \ /
  Last update: 2020-08-14 11:53    [W:0.035 / U:0.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site