From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.0 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9EC84C433DF for ; Fri, 14 Aug 2020 09:52:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 84609204EA for ; Fri, 14 Aug 2020 09:52:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727053AbgHNJwp convert rfc822-to-8bit (ORCPT ); Fri, 14 Aug 2020 05:52:45 -0400 Received: from eu-smtp-delivery-151.mimecast.com ([207.82.80.151]:57547 "EHLO eu-smtp-delivery-151.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727028AbgHNJwn (ORCPT ); Fri, 14 Aug 2020 05:52:43 -0400 Received: from AcuMS.aculab.com (156.67.243.126 [156.67.243.126]) (Using TLS) by relay.mimecast.com with ESMTP id uk-mta-236-lAlMELcPNvqeWmJZKrLkDg-1; Fri, 14 Aug 2020 10:52:39 +0100 X-MC-Unique: lAlMELcPNvqeWmJZKrLkDg-1 Received: from AcuMS.Aculab.com (fd9f:af1c:a25b:0:43c:695e:880f:8750) by AcuMS.aculab.com (fd9f:af1c:a25b:0:43c:695e:880f:8750) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Fri, 14 Aug 2020 10:52:38 +0100 Received: from AcuMS.Aculab.com ([fe80::43c:695e:880f:8750]) by AcuMS.aculab.com ([fe80::43c:695e:880f:8750%12]) with mapi id 15.00.1347.000; Fri, 14 Aug 2020 10:52:38 +0100 From: David Laight To: 'Luis Henriques' , Jeff Layton , Ilya Dryomov CC: "ceph-devel@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: RE: [PATCH] ceph: remove unnecessary return in switch statement Thread-Topic: [PATCH] ceph: remove unnecessary return in switch statement Thread-Index: AQHWch6rkdainQPrlU66/Hw4ZaLQ6ak3XLCA Date: Fri, 14 Aug 2020 09:52:38 +0000 Message-ID: References: <20200814093822.GA293898@suse.de> In-Reply-To: <20200814093822.GA293898@suse.de> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.202.205.107] MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=C51A453 smtp.mailfrom=david.laight@aculab.com X-Mimecast-Spam-Score: 0.001 X-Mimecast-Originator: aculab.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > --- > 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)