Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp406137imm; Thu, 10 May 2018 23:34:06 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpljx9fsjrFFMK9M5LWpRj4oZTs1hmQHCTB3mBRW/eBu4CHtQPp+2RSOqC4lUB4ZNkJywVK X-Received: by 2002:a17:902:624:: with SMTP id 33-v6mr4257008plg.361.1526020446565; Thu, 10 May 2018 23:34:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526020446; cv=none; d=google.com; s=arc-20160816; b=ZrXE80Z5o/mRGuizrMAorRGSDCv02VPOC4DjrbIUomsbhICox4LMUjuIwZ3wDtSi2c R3MPPaHjuwL5nmsEeHc/8DNsPHmxJfCHZq4Us6rzLvUlFDNJmrjr3o7ztWbxE0jFAevc Mle2APuoFdfxlWOmNMP81UaZ+l1cJPp5792G08t3r/YsPVBQNzyPqI1PzRaNWOCLh6vY BovVenhIboMFbZk+bdNhbbTBA8Q7sL1FlK8IyHKPvhqeHsHcRGpmJeA60AsHOB+whpTs wV6cidkmaOnwVK+MobgfSGJ0ds4UxbosmJhMalG6TD+krXWvafBYT3u3Xosl774MyO4q Qqlw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=B41oHirS+hZdcN5ojd2LFCd979Oh2wYJoLiXbdVh1Is=; b=jE546Bzqrsj2EP73Wo/SFSfBiCYyY94pmFhykD7nvyV54KdjQU0rXRZUB1CIwvqnxx 1LfndiS9lMN8heoy6ihwzSE0mZS1r324LKZR2XBPygdf6/BfxzQ/Vr3i9eLH+OWobSHp FQ8lFI7ou0fXDtR8UWmo03BebIxZN5OC/0OLsalLEkr4X0W6s4hFEqg4hz9K+XczsuHQ 1HUWuJfHpDSe08aqA/FVJHIyERgwJstio1g3AaTczkQvoWIgTCpHDjqkJIvO9ChhFcaP QuoH3f9RMednK5mEXho6d0aGTyLx1lCPVKSO4fdAcW5ViCpD7BWOoBmIgNvj6Twj01o2 3FJA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w12-v6si2107198pgp.252.2018.05.10.23.33.50; Thu, 10 May 2018 23:34:06 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752277AbeEKGdl (ORCPT + 99 others); Fri, 11 May 2018 02:33:41 -0400 Received: from verein.lst.de ([213.95.11.211]:51287 "EHLO newverein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750852AbeEKGdk (ORCPT ); Fri, 11 May 2018 02:33:40 -0400 Received: by newverein.lst.de (Postfix, from userid 2407) id 9792068B97; Fri, 11 May 2018 08:37:24 +0200 (CEST) Date: Fri, 11 May 2018 08:37:24 +0200 From: Christoph Hellwig To: Alexandru Gagniuc Cc: linux-nvme@lists.infradead.org, alex_gagniuc@dellteam.com, Austin.Bolen@dell.com, Shyam.Iyer@dell.com, Keith Busch , Jens Axboe , Christoph Hellwig , Sagi Grimberg , linux-kernel@vger.kernel.org Subject: Re: [PATCH] nvme-pci: Avoid use of goto in nvme_reset_work() Message-ID: <20180511063724.GA8368@lst.de> References: <20180510164645.19559-1-mr.nuke.me@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180510164645.19559-1-mr.nuke.me@gmail.com> User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 10, 2018 at 11:46:33AM -0500, Alexandru Gagniuc wrote: > This patch started as a challenge from Keith relating to code > structuring with goto vs return. I think the final result improves > readability on two counts: > First, it clarifies the separation between work struct and nvme_dev. > Second, it makes it clearer what error is being passed on: > 'return -ENODEV' vs 'goto out', where 'result' happens to be -ENODEV I think this actually makes the code much less readable. The only real improvement the code needs is to replace the "out" label name with something more descriptive like "remove_controller".