From patchwork Fri Feb 2 21:00:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Desnoyers X-Patchwork-Id: 196037 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:9bc1:b0:106:209c:c626 with SMTP id op1csp705078dyc; Fri, 2 Feb 2024 13:20:24 -0800 (PST) X-Google-Smtp-Source: AGHT+IHtmbnBnV/X9I19X6PiSJtwSNmjKaIORo7WwlgGpQV3kgAx2ZCi/y0vY/zjDUm90MOxRXVb X-Received: by 2002:a05:6358:6f9e:b0:175:f9b8:89bf with SMTP id s30-20020a0563586f9e00b00175f9b889bfmr3439007rwn.22.1706908824374; Fri, 02 Feb 2024 13:20:24 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706908824; cv=pass; d=google.com; s=arc-20160816; b=VsUjpD1nFu2Mw1OsnM5SuKpzm15S6hQYNGbT4kzysfWL+x2ukc4B325ijkCaZSp0E2 jnl8NdhWYOMNozu1fOp+ia4N7O1kEihsqPCh+JZ6iz0ZH5ys+JmUnpqsecGygm/RojUe DVDjosThn2pqU76tROW0S+dfAfR2f2WjK8aRhgpmfJXksmgnNerRPT3z4atbuCNhXPly FCx8phf09rkxprO1lE0Ff7SPp1bDyMVUcNuMM5XE25YdcV8cm8c8AgZOoNoZdIrW+TkN jH4ala02WV+UsExEs7UU5820dapSOfsb07oDEhoIRbLbZoBkQQHLHZNHT96XA0NMeDq9 aKrQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=l2wRmrDvqQckE3o82F7VoUp3GeHgriJVil7x/mcQt2I=; fh=xi4003S5yZ/KjVJOPrCuXL+3ZB4L1QRdA84kQgPZAO4=; b=s4dGa6uu6SNDiKD8BFbMdhqmCIYU2V9cp+x2MxKMj/WhxVCu5jOHj5pPwzCZe2FGXH tA4fhEe8hIqrpXUP/GOmyIsBEDzYp6McciY4it9J3Ocu9D/whsCmG7thrXq0czSnlV7g hM7zjohA+gdS9TbnjctHGY+XjqO55+2NxQHwui+rbHfywgHgY55yf3mO0RLNpHdFjgGh 6u8/uJ3kyUFO46HjX0Qx4T1d1bicdqney3KOQxRJCP1nnOggquKLPKcyOx8v0k9xuS7d ZEOuwXhQgvI/MbRDMAawl15fllDbra6sog+kFz7+i3ITTa1MAJRgQ2wS0DppUr9I0mRD rPRA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@efficios.com header.s=smtpout1 header.b=t638+rYb; arc=pass (i=1 spf=pass spfdomain=efficios.com dkim=pass dkdomain=efficios.com dmarc=pass fromdomain=efficios.com); spf=pass (google.com: domain of linux-kernel+bounces-50581-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-50581-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=efficios.com X-Forwarded-Encrypted: i=1; AJvYcCVSI03/bJaHDRR/dnV6RGbTjiA4hdZ2YEcxwxdbNpoNHTqRbw10W+whz8zdqD9E1HOn0qJzDf1vnOwABooeD6iNWt/nww== Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id w31-20020a63491f000000b005d8bb99ff31si2148326pga.683.2024.02.02.13.20.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Feb 2024 13:20:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-50581-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@efficios.com header.s=smtpout1 header.b=t638+rYb; arc=pass (i=1 spf=pass spfdomain=efficios.com dkim=pass dkdomain=efficios.com dmarc=pass fromdomain=efficios.com); spf=pass (google.com: domain of linux-kernel+bounces-50581-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-50581-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=efficios.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 51666B28B75 for ; Fri, 2 Feb 2024 21:07:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1A12D13A89A; Fri, 2 Feb 2024 21:00:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=efficios.com header.i=@efficios.com header.b="t638+rYb" Received: from smtpout.efficios.com (smtpout.efficios.com [167.114.26.122]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5305812F36F; Fri, 2 Feb 2024 21:00:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=167.114.26.122 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706907635; cv=none; b=q7EbqE1b4k03KfNsQKofiTRsDtv4z+Ea0wvbxYytvaBTb7IiIH8KQ6vShaSEVLFlkjUgq/xmEm5Mt4kp9ZOL1gUuRTm8vKBNdn6kd7ah8nWwIohy8PfE0yzWYXCXU2ughqvSCgSgh7YZqEDcJDTUPocOMGFeZSCN8pI1cX3u/rk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706907635; c=relaxed/simple; bh=Iy1T66BEIuPj6bTS95Nd9D5h8aE2OAfCM3Sw4sgOgjA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=qNThyIjYh/AasJ8vZSWtpVp0CGe663YVEmeszuheWz/18vT7M1LGQyDkb2ceJf8IVf+imFtgHrP3Pa0JJdi4kHrdVXCI6sY5BEFOx/LqaAm9O7028jsP/IpdL0BhipbMHzm4RP/3Kty3tjPw0t2CCjD9hvBQdAJjhn12Tzl9dak= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=efficios.com; spf=pass smtp.mailfrom=efficios.com; dkim=pass (2048-bit key) header.d=efficios.com header.i=@efficios.com header.b=t638+rYb; arc=none smtp.client-ip=167.114.26.122 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=efficios.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=efficios.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=efficios.com; s=smtpout1; t=1706907630; bh=Iy1T66BEIuPj6bTS95Nd9D5h8aE2OAfCM3Sw4sgOgjA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=t638+rYbOFyXGgFVCvFYOjUcEKa8934Yh63zuA8Ip6CU+8nNAmiILkFgP8nw6XNPm ex5CrBXXgswNdV/g8sBEiCvZYGg4PT9Lwyg/6bqVeoJd9Y6lUnnrRi5CJEebiyiNGc BE2bJEKg6gCvFyhHXyT6qlw2C/xtKJ4ydBnC7IKca5iBk50a9s7RMnjLexCDeQIzct afJMtBUYLz+HyBuALYfSgAhiSzzmkVG4JGiBZH0W9xaSZtl2ODjuUL+l+9YbPksYZ/ L/+hs3IKD1BF2vqbCEzbqvXahtVAWhb4urtvIiA9DqevrCh76z9aa+kAAqoSPkK7Gj QCrn07lWmahCA== Received: from thinkos.internal.efficios.com (192-222-143-198.qc.cable.ebox.net [192.222.143.198]) by smtpout.efficios.com (Postfix) with ESMTPSA id 4TRSpk37PFzX4X; Fri, 2 Feb 2024 16:00:30 -0500 (EST) From: Mathieu Desnoyers To: Dan Williams , Arnd Bergmann , Dave Chinner Cc: linux-kernel@vger.kernel.org, Mathieu Desnoyers , Andrew Morton , Linus Torvalds , Vishal Verma , Dave Jiang , Matthew Wilcox , Russell King , linux-arch@vger.kernel.org, linux-cxl@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-xfs@vger.kernel.org, dm-devel@lists.linux.dev, nvdimm@lists.linux.dev, linux-s390@vger.kernel.org, Alasdair Kergon , Mike Snitzer , Mikulas Patocka Subject: [RFC PATCH v4 09/12] nvdimm/pmem: Cleanup alloc_dax() error handling Date: Fri, 2 Feb 2024 16:00:16 -0500 Message-Id: <20240202210019.88022-10-mathieu.desnoyers@efficios.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240202210019.88022-1-mathieu.desnoyers@efficios.com> References: <20240202210019.88022-1-mathieu.desnoyers@efficios.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789823627553649812 X-GMAIL-MSGID: 1789823627553649812 Now that alloc_dax() returns ERR_PTR(-EOPNOTSUPP) rather than NULL, the callers do not have to handle NULL return values anymore. Signed-off-by: Mathieu Desnoyers Cc: Alasdair Kergon Cc: Mike Snitzer Cc: Mikulas Patocka Cc: Andrew Morton Cc: Linus Torvalds Cc: Dan Williams Cc: Vishal Verma Cc: Dave Jiang Cc: Matthew Wilcox Cc: Arnd Bergmann Cc: Russell King Cc: linux-arch@vger.kernel.org Cc: linux-cxl@vger.kernel.org Cc: linux-fsdevel@vger.kernel.org Cc: linux-mm@kvack.org Cc: linux-xfs@vger.kernel.org Cc: dm-devel@lists.linux.dev Cc: nvdimm@lists.linux.dev --- drivers/nvdimm/pmem.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/nvdimm/pmem.c b/drivers/nvdimm/pmem.c index f1d9f5c6dbac..e9898457a7bd 100644 --- a/drivers/nvdimm/pmem.c +++ b/drivers/nvdimm/pmem.c @@ -558,8 +558,8 @@ static int pmem_attach_disk(struct device *dev, disk->bb = &pmem->bb; dax_dev = alloc_dax(pmem, &pmem_dax_ops); - if (IS_ERR_OR_NULL(dax_dev)) { - rc = IS_ERR(dax_dev) ? PTR_ERR(dax_dev) : -EOPNOTSUPP; + if (IS_ERR(dax_dev)) { + rc = PTR_ERR(dax_dev); if (rc != -EOPNOTSUPP) goto out; } else {