From patchwork Thu Feb 8 18:49:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Desnoyers X-Patchwork-Id: 198539 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp391379dyd; Thu, 8 Feb 2024 11:08:36 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVDQdrQqOFvnNjqvJtn0aRQfffn5xQXEMil+ONHZnJ000V/+PsUgIcz9cf/uLBVf90kDofSVHvlS1riqtxFdJ0unmKKaQ== X-Google-Smtp-Source: AGHT+IESFk+5wRTFwYoAl7UvnT88JV2iZd+5kcbPPTDWmKkLa0pMS7skF7IW+kWRR1FFPBzBII72 X-Received: by 2002:a92:db4f:0:b0:363:bc92:e4f with SMTP id w15-20020a92db4f000000b00363bc920e4fmr599007ilq.23.1707419316409; Thu, 08 Feb 2024 11:08:36 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707419316; cv=pass; d=google.com; s=arc-20160816; b=LggLRse4vdwwOab5VAbYrViSRzEFAuEVR/9odWriP/2Ha1MZJpK98JbAtX6ABx0A0m ruXCoiTk1R1xDf1cJLYnEJHQXUJ4o/p0xPtSs2vYrqWdTbylFGZ7Fmkjlm2wTUHd/99K BnJXlFF5tWxP6WDteYs9/L7HeRyb9HzRRMZRthxZqJy4s/EBfqiGgSt6+zfz3+iMczJm Q0gw0phKz6XLEzG0fY2I1CJJsdTEb8zyF0MBjlwcjMvN4GRVnEmdu84XUPwc+MtHKk7O SY3saFrOfiRCaHuwU8x/DOqTH3+wUcGeRUYcx7l+96NS0tBgV0wrQDHp48D85Eow/pdz BNRA== 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=74omjQE4L9culWlI1CoKTUZ5x+EdSe1Do7SZBuQubzY=; b=WmxbEkx5SMwr4bUzez79aXvCkcSn6jBl0gC9dJOpoHZn3q0K+KZwtJhZTliVWNAPmz P9trmJvo5LtQBK4hAWWAI7gL6OODN6K65gfBctdcCjnHvI7FyOuhQVXSTeWlG9WiDusb Gf7lxVyeRuhgvyBViLrcN6mpvKXf8id7V+YMfLrqLWui8as8iGgmqk84laDQnt1HCSsu YcP/PgFsE/vW1y9fDUV+SCZZny966x0CvjP1NpvOVyWLd1suP2JGlWFw+MIyjfaCxhxD SxdwPrEwgPfVQ1yZJ2WBVz7X34pE1YMZqxGhAhqLn6dIIa0krSLp3rkoNzziKRP4CTsX swoA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@efficios.com header.s=smtpout1 header.b="vtjc7/2f"; 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-58576-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-58576-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=efficios.com X-Forwarded-Encrypted: i=2; AJvYcCXQl88PEEaUn/XhXHg/2x54d3Zu0Zzmp5GBIkprsgKgxDR4+oQRCPQvSis+dLidF4kNpr2YHtRkXTqjzfMaqqQzHiZhaw== Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id k63-20020a638442000000b005d92a3f1196si217650pgd.592.2024.02.08.11.08.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Feb 2024 11:08:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-58576-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@efficios.com header.s=smtpout1 header.b="vtjc7/2f"; 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-58576-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-58576-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 1365C2946D5 for ; Thu, 8 Feb 2024 18:57:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 981D94F8BA; Thu, 8 Feb 2024 18:49:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=efficios.com header.i=@efficios.com header.b="vtjc7/2f" 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 982E12D05C; Thu, 8 Feb 2024 18:49:34 +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=1707418178; cv=none; b=QGtleAqVWcg0gAbLqcPq+4T9SRccImk359ZvZML/R0Q2KBoze2CtzahaVSEDLag2bwnaeriEB8mo9lXdRZp7H8DxlDEMWLxl+ydeUdEfjjpV4mT18KxmUFuPS+3LRZ3jbHa0oySeHX6MIyxM+b12Jhaxgo9CBr2FnG6ARC33Dsg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707418178; c=relaxed/simple; bh=Iy1T66BEIuPj6bTS95Nd9D5h8aE2OAfCM3Sw4sgOgjA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=X1HpXTUmKAo2jjd9LTR5UF3bnMKZNEzQ0Dz4i6nFJGdgF5wj39sXESUmG6zL4pc5JhWr1twe6jjSCHZtO8nojMENTVmUC3e39JyYPo8+byqMMGFopxs5aARsqf4Uc5+PL4XQLz9Q8udqFqzwsQfTwc/1lUO7oDUQa/JmdTnGWSE= 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=vtjc7/2f; 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=1707418166; bh=Iy1T66BEIuPj6bTS95Nd9D5h8aE2OAfCM3Sw4sgOgjA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vtjc7/2fYgtbG9L3HmHuiZ0hGJa5dwKDXt/n16lAht+M2tw/jI1e25yKjrmZukvCz /CX1mCneF7UyCbUOI4h3G4fdzzSb+li471Gx6ba8eevnycoFnHMSk9/h7wbWMnbYvz 6nZtKBy7/E8bqAxj2lbFepGPrzFubBQ+wr2SChDD6HS2Wn+qRldp0qwKKSKFtnBJIU OLFpBjTdvJMQftoRrtnmWegJrS0zZtCdd9sUdS3eoFkCZdZGdSYOE7mkXPbWW5GCXd tkUbHVYezf/E/8BNNB/B1FE4KQJPivjjt8+FxxLo9L9C6/i/PG/zlxN+sluj3adEJD E0pl1Ko8zJjwg== 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 4TW5ck2DcczY2L; Thu, 8 Feb 2024 13:49:26 -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: [PATCH v4 09/12] nvdimm/pmem: Cleanup alloc_dax() error handling Date: Thu, 8 Feb 2024 13:49:10 -0500 Message-Id: <20240208184913.484340-10-mathieu.desnoyers@efficios.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240208184913.484340-1-mathieu.desnoyers@efficios.com> References: <20240208184913.484340-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: 1790358916932607447 X-GMAIL-MSGID: 1790358916932607447 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 {