public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: David Laight <David.Laight@ACULAB.COM>
To: 'Luis Henriques' <lhenriques@suse.de>,
	Jeff Layton <jlayton@kernel.org>,
	Ilya Dryomov <idryomov@gmail.com>
Cc: "ceph-devel@vger.kernel.org" <ceph-devel@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH] ceph: remove unnecessary return in switch statement
Date: Fri, 14 Aug 2020 09:52:38 +0000	[thread overview]
Message-ID: <a1a68d9a887148ae9a80ca103d112e6b@AcuMS.aculab.com> (raw)
In-Reply-To: <20200814093822.GA293898@suse.de>

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)


  reply	other threads:[~2020-08-14  9:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-14  9:38 [PATCH] ceph: remove unnecessary return in switch statement Luis Henriques
2020-08-14  9:52 ` David Laight [this message]
2020-08-14 10:03   ` Luis Henriques
2020-08-16 14:00     ` Jeff Layton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a1a68d9a887148ae9a80ca103d112e6b@AcuMS.aculab.com \
    --to=david.laight@aculab.com \
    --cc=ceph-devel@vger.kernel.org \
    --cc=idryomov@gmail.com \
    --cc=jlayton@kernel.org \
    --cc=lhenriques@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox