Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp469413rdb; Thu, 8 Feb 2024 10:57:07 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXwBwMkLo257hY9NO2H/42k6Df59z96Q65w9Aphavn449eJp/eqTvCLelpCjaAkpxDHYoZwDeYUk5WV6afXVAj1hYs/r1MbkF2JgEkOzg== X-Google-Smtp-Source: AGHT+IFIlrRMcFs+UHmCvZZtD8m+Kk1uLyl+NuXThLdwuGN86ILqzvD6l/0iY+MXkcLOp0MKms9R X-Received: by 2002:a05:620a:2906:b0:785:b264:485a with SMTP id m6-20020a05620a290600b00785b264485amr247914qkp.35.1707418627200; Thu, 08 Feb 2024 10:57:07 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707418627; cv=pass; d=google.com; s=arc-20160816; b=KNohIJhqqpnC0UKoOA7P82ZR7/2Cr2r9FEv7P/FlaVVa1uo3JXYzI8ppE8IMqYfqg/ OzktcNr+g/tYT7r49S/3kSmEHzn1TwE4MJG1yYiPPj38xxch++oDRMbDbSmBarS0G/Ly 70OaCgEgZZyNmFbDbstYnqx6Su/QdMXGkwj0ZRD+dpu54JGGmafi5eQcA/N0VHSXqoCk +b94BP1pUzwMFYVRUW8WHoLALVIEufFscm35yX7fv8qCoVUzEjaC+667MpKg6jyR4Q1F HnBjrHRI3OzJ11tbJ1JxaqoKreAve2Q8Ki08O1D4wBrD9vOrp+ji0T7K46cjrt49Zdza uadQ== 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=9VUmh9D6ywUbrRS7NdYePbl9mGrY9c+8WQlluKwGPSc=; b=VCUYxG5OgKHCwb42f/Mnw2ngr8mr19U9OYaKHuyrqskclIBTjBVVDAYwIuegfv4p2W ZHl993POj/TaVqTiKjXQnxo3XL6Sb9txwALwgrhHiLyMsxgNA2VpyAPZQTZ5JgaC/THS Gxjj6pUDOINUgD2TWiD+LtfSUgSGL2MBJSIV1CX+89SfKPpxc348ez5igWWJqLtq49PT Kg0xxXrGS55GebthmAsbrU/hnRbxOoEVlvm67boykRDjVW9S+I2PjHDyBXgd7+ebpN3J hzmDD8dPTJm5qJH0YlHFAqmZID8tAW8MPpRGQuH99aNA7u9pHcbz+/CO3M9Kly4TeeXZ +waA==; 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-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-58576-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=efficios.com X-Forwarded-Encrypted: i=2; AJvYcCWSy/8ha9CIUnx7Hl3GyrMZ8sUT4lyrJqwIsvjwcgDFAroQY6T4wuOGM7rXN5qsA90HT0h/7XvF1srKVFlkQALzbLblyjy8tbs6pbUjzA== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id m4-20020a05620a220400b00785a3a542d0si204398qkh.291.2024.02.08.10.57.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Feb 2024 10:57:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-58576-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::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-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-58576-linux.lists.archive=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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 4D7D21C29D51 for ; Thu, 8 Feb 2024 18:55:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E0F984CB2E; Thu, 8 Feb 2024 18:49:42 +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 Content-Transfer-Encoding: 8bit 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 { -- 2.39.2