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: 13543408 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 635D4C4828E for ; Fri, 2 Feb 2024 21:00:56 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 904416B0096; Fri, 2 Feb 2024 16:00:33 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 883A36B009A; Fri, 2 Feb 2024 16:00:33 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4FB846B0099; Fri, 2 Feb 2024 16:00:33 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 2B7C06B0096 for ; Fri, 2 Feb 2024 16:00:33 -0500 (EST) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 07DE240FD7 for ; Fri, 2 Feb 2024 21:00:33 +0000 (UTC) X-FDA: 81748082346.06.851F411 Received: from smtpout.efficios.com (smtpout.efficios.com [167.114.26.122]) by imf06.hostedemail.com (Postfix) with ESMTP id 56025180023 for ; Fri, 2 Feb 2024 21:00:31 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=efficios.com header.s=smtpout1 header.b=t638+rYb; dmarc=pass (policy=none) header.from=efficios.com; spf=pass (imf06.hostedemail.com: domain of mathieu.desnoyers@efficios.com designates 167.114.26.122 as permitted sender) smtp.mailfrom=mathieu.desnoyers@efficios.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1706907631; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=l2wRmrDvqQckE3o82F7VoUp3GeHgriJVil7x/mcQt2I=; b=YzuKV3m2h3n+17EnLsRvX9ZiqSDePLhGi2yQ7ylRFmYx7SwX4FHklKupCoTcthhL0di8Fw 1uaOEfuF6vwwDLSrLT3dTHJXu6bDEdrl9RdzP7iWFtHNFyQBQaSVO0jOww3KpVX7WS9BwT zr5i2jYKDf7CbqWk9ITjg5rzV+7Y+sw= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=pass header.d=efficios.com header.s=smtpout1 header.b=t638+rYb; dmarc=pass (policy=none) header.from=efficios.com; spf=pass (imf06.hostedemail.com: domain of mathieu.desnoyers@efficios.com designates 167.114.26.122 as permitted sender) smtp.mailfrom=mathieu.desnoyers@efficios.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1706907631; a=rsa-sha256; cv=none; b=BHmyiBrTRuXIpkshfzDnWFWolOghUPkWhmmN1nFspWjxLFDQ/Q7QsV5qratC19qoAjdH4v lGnx9nB/qg2OajQ/U4W4WiFCTmuYel4Jgh5J5DGWSdHl7BhleU4jaFie/V4K42jmeUwZZC Ys5lVjsQZ3nOplzgUp4tk4tm/GWmR30= 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> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 56025180023 X-Stat-Signature: 9m7i3s3gtxhradtz5r7xnwyfpw48of9j X-HE-Tag: 1706907631-436835 X-HE-Meta: U2FsdGVkX18ZWjK7F/0+M7DdxyK1FCFqKtFWgF/nNSygdNj+i+HZzKzCz2jalJdlHKdgiYb6BmPEbifdvlmERO6TiyncoKG1ZCBECXXeUZDc6y7Wi0DBci4iZhM8iTqe9Is3BejOa4fdAc8wQ2gmz8jGu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QqWg1aNWYcg43EMatxxoHBXNsbISfYc2aJJrxVMn/aXJl2CRiJ6JneF0SWMvUGaHFV9AN+/0NhPdWjON+HYhDqoEuGaMAry6P/S7HxOrGeX9xPKFenm2PkyHT4NBfvQyKjDpfAIds0HO241TufuepS9fuieQRsBYoxpXkDYor7T27FIAUKCvtyJMiSEHECigmVwL448j8kQ9yTCJx8Wd4ar384gH4OjFTYH0oLF8zQNaksyl4pHy7iDyfwTPZaVht5M0n/wJHgxNsfe31UEkV0Bt/HwmndYuSx/3+/1fAbjV3ljz6j7vpM2m9HPw3RDvdCnkbtY5lyFLXdZeffY9c3Lg2n+7NvQJuKefIW72fFNkDkKHsQ0WA58I8Jj4cmahrHBR5zeeWB/kDNxQHRN+/g= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: 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 {