Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2234456pxb; Sun, 31 Oct 2021 10:52:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxdFtb6tTp9yDMUQFY+3bL5/qJ0EPtgHh7dCiR4voO7ZnS25GoAs9Jz927m9xAONjybMVj8 X-Received: by 2002:a02:620b:: with SMTP id d11mr17887147jac.69.1635702749337; Sun, 31 Oct 2021 10:52:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635702749; cv=none; d=google.com; s=arc-20160816; b=uXJ2+Q9YkszNXlLSxt4ug8aQjMXbHCfOEJtPzvOmIerdEzzPf/4ZuPprJw0A1rYZvb aOyL1r3C5yPQ30GskAY4AvzvmJgmqEu/n0BV1xrzdE7XfcfPEh++XGBMv4/drYmCNXJV S3cdthsEGk+YpyKGsV9XQDvJHBuGPZp5AZlrdKX8zBVznm0TkvGmsJ0FiSxy3mvv8qgB bqZC7HrweshC3AJM4IgbaoONXMvOxfmsuyxgWAB9aUZMi8OjT/JZtXJ9mCheyz3MBLvX 1z6FAZSw3qL7AiRR5hR9ZJ+oDSffpOgxnpmVosHSFtUpTTE2OYsx/PzM+O9sPa9cSSQb xo+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=f8mR+D/eH/dZNNjPVwCwixw0JTq5UBSJUqcsN3WCTdc=; b=xiTyrgUgchGl8HXmVn9I/zYCplobQF4SAUv7U1ElqRjCuB1G1nQsJuuhdXpq+U1EG7 pH6wUY8cxsgEvb2qSTCthbmeyM+p2ssWpSn5NTwaAtsPVRqKHiRIiIcZqHREGLoYGDmc TXJ0xSm/ohHUf6xOkDl55Eq5aYSl1rRt2RPRIBQt5ArEvFG6n7iNtfJLnghhwp+jkWkI kPoM/3DGs7XdREXg6PH57Vc0Cib9mq+YEi/6cqB3x1RuVs5slhg0pX56lqYRzWIjTwol NDRfTjJ/U0Vtx0gyH2yBryvOeC5Ed3apD4g0jC44gpXdz+HIE1eHWqGp0FLVETB9SWlN h91w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel-com.20210112.gappssmtp.com header.s=20210112 header.b=MvRLH8wC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x5si22721515ilu.173.2021.10.31.10.52.17; Sun, 31 Oct 2021 10:52:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@intel-com.20210112.gappssmtp.com header.s=20210112 header.b=MvRLH8wC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230041AbhJaRxv (ORCPT + 99 others); Sun, 31 Oct 2021 13:53:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37580 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229732AbhJaRxu (ORCPT ); Sun, 31 Oct 2021 13:53:50 -0400 Received: from mail-pg1-x535.google.com (mail-pg1-x535.google.com [IPv6:2607:f8b0:4864:20::535]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1A3DAC061714 for ; Sun, 31 Oct 2021 10:51:19 -0700 (PDT) Received: by mail-pg1-x535.google.com with SMTP id s136so15130627pgs.4 for ; Sun, 31 Oct 2021 10:51:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=f8mR+D/eH/dZNNjPVwCwixw0JTq5UBSJUqcsN3WCTdc=; b=MvRLH8wCuHLDGU5wWh67k3cqC1Fdd3cZizRDNMF6VwG3BIGVykQrXQ5XqN/SFH4gF0 aMNjx/sd3ls8H4qnD1YxCP5l5GJAAEpAG/Esp4V6LKux9NYOWi96TwUZ/pFb3TcmZBWP zVBzvEL+MVUnbMk9GV0AJMQQu68lxnATIX9jNgOg6W2MrQQWyRvUFoiusZtaNgUAPfI1 AxT4pyI0WF/pD617rNm69wlS3SI/GAt5yD+1ZKqpLA3r9I/GOI56o8ePSp4PP7gIIGX3 ZjKHBLE0TTaieZDjpKAQiXOrBhNCxqkLUX94RtN1Jp6OGXuvi8GYPomwsciSqBwOSwmF zWpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=f8mR+D/eH/dZNNjPVwCwixw0JTq5UBSJUqcsN3WCTdc=; b=hfMo/t82SfSOWmmSbMVxEk2mqggt4zMFcU0VGsiKbcQez7KO0PsrQKBW1cVP3a5MsF O45JZXuBQU6uVUuM+Kd5lXzFo02KWVQvZJwYntMXBbbY2tHpknMYYnyW1nxqGBWN+Iph YS69MEU1KYOLPK9/OvDuKgME/KhWNHULx/lWicNnW0bYknNjO0hQx9jdPDATmtqQBsSz o8SvGknIpuecBzgENTZi8eScZpVlMoon0xMuI4iglD7jjiBVJLsJOdhYfuiIuJ6pAc1Z qOkWRuYZEjqh70tcI484UjaKZBAyw+hE2B5n7vdOkX3ate7cYqrQ8lSMaYeOtbKL3gv0 UBeQ== X-Gm-Message-State: AOAM531xjHHLSylIg4UnEzg85AgtAdxCC4mpETIiJz1H2YgaaKHqFNAc 3n9kejodQbV4K2Fm8nlo5a1rxAbGRJWbowRMviyrkg== X-Received: by 2002:a63:6bc2:: with SMTP id g185mr17997770pgc.356.1635702678641; Sun, 31 Oct 2021 10:51:18 -0700 (PDT) MIME-Version: 1.0 References: <20211015235219.2191207-1-mcgrof@kernel.org> <20211015235219.2191207-5-mcgrof@kernel.org> In-Reply-To: <20211015235219.2191207-5-mcgrof@kernel.org> From: Dan Williams Date: Sun, 31 Oct 2021 10:51:08 -0700 Message-ID: Subject: Re: [PATCH 04/13] nvdimm/btt: use goto error labels on btt_blk_init() To: Luis Chamberlain Cc: Jens Axboe , Geoff Levand , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Jim Paris , Minchan Kim , Nitin Gupta , senozhatsky@chromium.org, Richard Weinberger , miquel.raynal@bootlin.com, vigneshr@ti.com, Vishal L Verma , Dave Jiang , "Weiny, Ira" , Keith Busch , Christoph Hellwig , Sagi Grimberg , linux-block@vger.kernel.org, linuxppc-dev , linux-mtd@lists.infradead.org, Linux NVDIMM , linux-nvme@lists.infradead.org, Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 15, 2021 at 4:53 PM Luis Chamberlain wrote: > > This will make it easier to share common error paths. > > Signed-off-by: Luis Chamberlain > --- > drivers/nvdimm/btt.c | 19 ++++++++++++------- > 1 file changed, 12 insertions(+), 7 deletions(-) > > diff --git a/drivers/nvdimm/btt.c b/drivers/nvdimm/btt.c > index 29cc7325e890..23ee8c005db5 100644 > --- a/drivers/nvdimm/btt.c > +++ b/drivers/nvdimm/btt.c > @@ -1520,10 +1520,11 @@ static int btt_blk_init(struct btt *btt) > { > struct nd_btt *nd_btt = btt->nd_btt; > struct nd_namespace_common *ndns = nd_btt->ndns; > + int rc = -ENOMEM; > > btt->btt_disk = blk_alloc_disk(NUMA_NO_NODE); > if (!btt->btt_disk) > - return -ENOMEM; > + goto out; I tend to not use a goto when there is nothing to unwind. The rest looks good to me. After dropping "goto out;" you can add: Reviewed-by: Dan Williams