From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755642AbcAYJ0U (ORCPT ); Mon, 25 Jan 2016 04:26:20 -0500 Received: from mx2.suse.de ([195.135.220.15]:55818 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752128AbcAYJ0Q (ORCPT ); Mon, 25 Jan 2016 04:26:16 -0500 Date: Mon, 25 Jan 2016 10:26:12 +0100 From: Johannes Thumshirn To: "Singhal, Maneesh" Cc: "linux-scsi@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "JBottomley@odin.com" , "martin.petersen@oracle.com" , "linux-api@vger.kernel.org" Subject: Re: [PATCH] drivers/scsi/emcctd: drivers/scsi/emcctd: Client driver implementation for EMC-Symmetrix GuestOS emulated Cut-Through Device Message-ID: <20160125092612.GB29561@c203.arch.suse.de> References: <82807C73E0BDBB498164AAE7B8F6A1481C61263E@MX105CL01.corp.emc.com> <20160119160421.GM2742@c203.arch.suse.de> <82807C73E0BDBB498164AAE7B8F6A1481C6181A4@MX105CL01.corp.emc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <82807C73E0BDBB498164AAE7B8F6A1481C6181A4@MX105CL01.corp.emc.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Jan 23, 2016 at 05:51:50AM +0000, Singhal, Maneesh wrote: > Thanks for your time. My replies inlined... > [...] > > > + } > > > + > > > > You don't do any cleanup work at > > ctd_scsi_response_sanity_check_complete. You > > could just reutrn 0 here as well. > [MS>] Just avoiding multiple exit points from the function Please have a look at Documentation/CodingStyle Chapter 7: Centralized exiting of functions. Especially this part: The goto statement comes in handy when a function exits from multiple locations and some common work such as cleanup has to be done. If there is no cleanup needed then just return directly. and the example below that section. > > > > > + > > > + ctd_dprintk_crit( [...] > > > + if (request && request->io_timeout < EMCCTD_MAX_RETRY) { > > > > The following block is a bit long and therefore it's hard to spot an > > eventual > > error of handling the io_mgmt_lock. Can't it be factored out in a helper > > function? > > > [MS>] I know its little longer, but actually fits logically together... Will see if it can be factored. Not sure though. Yes please. It's not uber important but short functions and paths are generally favoured when debugging and reviewing code. Thanks, Johannes -- Johannes Thumshirn Storage jthumshirn@suse.de +49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850