Received: by 10.192.165.148 with SMTP id m20csp1393474imm; Thu, 10 May 2018 09:59:48 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoivWUYsDA74EVINwO3II9FanBUrOQFFAW05aBWD1faYOvptS6t8/Z2hKyH4OO0gMIngZtO X-Received: by 2002:a17:902:9004:: with SMTP id a4-v6mr2065478plp.143.1525971588116; Thu, 10 May 2018 09:59:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525971588; cv=none; d=google.com; s=arc-20160816; b=LMpVcr8cdItIM9CqzAoPAl+5bzfyQeuJoSDfl9a4Xr/GNc8axWbJnA6Jd7YCxjkL4/ YFnlp4S6cSBw71lFLlbtDgbFl3ufIcV4skYCikkSgSOkJ352+5U5jBUXNq9A/Ojtsp05 dd4HbKpNfHlYB13iBY50xOj0wFm+G9ISi+42vlDfIc7qjmzzXxF/LutQ9iUdNmKL68CZ u69J1caFrEMdkFdpLIERyU1YaW1ROhAssYt9Twh4dLWjdb+wksKIavCvHwVhflSKgQef B+efooy1WGCI6FA2MhidU5/InGbJbSSe7GQWGpVDfhP0kTN4yS947uq1LilwvkbQGnp4 PLjQ== 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=5O+JF79y0TtVMnkYWe+lbtrnf8T+t2vZ0JdBUJZp8vY=; b=jnuXWP69IOvYpACB0hCtVe6pFhrYiZf+7dXZ+Nx5J6r5s4+l4TQyLCblYluAa6uQ3u 6YCJxLjaruAltVpBFYgPhvtQx+vWltCAVo+kZ91PpS14mF22SvcQr9RXnQyjs+EAXqps drwu8ECE1PfixUDk0aoLTcBZdrXma1PKMXesoS5tx4HT1ddMawrwv8HQq4/uGoVW11xf Ce/lzraqVtlMAHvsEEKdzJDtQSCqlHiQFMQ8EpCwx/WYhh0pJPdnk2QLydA/LKY+9Na6 wKe8Fp8gG8mOLjum8pwRVZ4yX2hNU0ahEMRxMAW7A4FLUfx0T6cwcdlTinL3OPjLZPv6 7Z5Q== 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 f5-v6si904439pga.595.2018.05.10.09.59.31; Thu, 10 May 2018 09:59:48 -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 S966512AbeEJQ6v (ORCPT + 99 others); Thu, 10 May 2018 12:58:51 -0400 Received: from mga07.intel.com ([134.134.136.100]:6338 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966305AbeEJQ6v (ORCPT ); Thu, 10 May 2018 12:58:51 -0400 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 May 2018 09:58:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,386,1520924400"; d="scan'208";a="44880216" Received: from unknown (HELO localhost.localdomain) ([10.232.112.44]) by fmsmga002.fm.intel.com with ESMTP; 10 May 2018 09:58:50 -0700 Date: Thu, 10 May 2018 11:00:39 -0600 From: Keith Busch To: Alexandru Gagniuc Cc: linux-nvme@lists.infradead.org, alex_gagniuc@dellteam.com, Austin.Bolen@dell.com, Shyam.Iyer@dell.com, 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: <20180510170038.GA4556@localhost.localdomain> 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.9.1 (2017-09-22) 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 > > CC: Keith Busch > Signed-off-by: Alexandru Gagniuc Ah, that's just wrapping a function that has a single out. The challenge is to find a better mechanism than 'goto' to unwind a failure that has multiple outs, like nvme_probe().