Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp2936091pxk; Mon, 21 Sep 2020 00:24:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxKSaOIswxEPNVZC/Wu9JwIYKzUNmyZdEndGMM4tNZVrFMzUb8gH7jZoao0mw/A5OXWinWI X-Received: by 2002:a50:875b:: with SMTP id 27mr50161105edv.117.1600673073289; Mon, 21 Sep 2020 00:24:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600673073; cv=none; d=google.com; s=arc-20160816; b=b/miV785MWXfAxNwo3oDi3HfKHuXEy+34Xdru4ZpIH0K98WkVJXmy2W+ej9WrdEKD0 4Hh0M/PP8UO2u55hdRpyyz0jKW/IF5nI/NEDyzXWgjvfvp9YfkabDabzeevpb+zecS3B wlpUv6ohudqd6q5Q7CCHob7Vs0bqocPAzUlmMAw6J+SE5WkWVsTIpj8wDI3nOJY8PpQ8 tD8wG545wVYj1CbvKhJk9drpw+rSRZ649ZjM5/Kg8hNR2m1V+scYwAeIxjj0bKgGbuRy N+TWiFzA4w1+yHbYNKkr/gnFzWSAaRh5RsLs/hsPlExON2O0HPbRck/NHDIJ6voFbbMt cipA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=blabZPmWXgG0cxcX0iPoG2CU0yB/dn2E6XMr7wtvOlU=; b=YVAAjBNW0nzQi9GKu08BDGuiaKilSXKQJd8PoeOkM/p1mG0ZeNLT+VQMwTx5mqI88O 3mMASGVQW+gzUs9/7TBvH0BP59J/mL8HEyXfqVWrxmkAizc6v3NhJMYMEOOWFqTGiQLL ggpllat1qLf/1tZliEk0VHQR7r99Zh9/KZSRzXkJj2OlvTW2zbbQwhHTu1zIm5XOU34q /I7Js950qaoNaA4smtiX2cpsiB65hruOZddGu8kDc/wDqlmMKT2hGNm4oQN8zWh5SrCN 5MwmXuOVKJ4f146LCdeBkluYbtvEoc9WjdKq6pM3caIp0rSQI4qc3x8t2OisbDxAHTDR tatQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=P+xH+vZ5; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z2si7675081ejj.455.2020.09.21.00.24.10; Mon, 21 Sep 2020 00:24:33 -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=@infradead.org header.s=casper.20170209 header.b=P+xH+vZ5; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726683AbgIUHUx (ORCPT + 99 others); Mon, 21 Sep 2020 03:20:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59404 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726582AbgIUHUS (ORCPT ); Mon, 21 Sep 2020 03:20:18 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 43E4EC061755; Mon, 21 Sep 2020 00:20:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=blabZPmWXgG0cxcX0iPoG2CU0yB/dn2E6XMr7wtvOlU=; b=P+xH+vZ5WozDW/mPdPOoeSIebG XZS2jbwOYrOnTthQk0Uhm2SN87yRyDUn+1hDAtJuRjjVe/XicpMadZaTTfDzItsqRxP8o2qV2xw+J wgYD2nLuTxeNFRAUjWM1VtY3PaSm5zVdGYXpcad8hFndoD1AZSe2iSlkKP1/tdil7vhDgqkhDxwQS E4kZzfmz7B2OoGgbvaA3W/YOA3nGsZTkMQbjCf6TCyC+pOZeLaPcFY/tOyz9SKH45tfIIXYTwB611 bGDDyetv66m9+BQacOd9O8B2x2ftPjyj+cyfGSSLbX1LbAlrCntf+ngFdzLp9viVESfnCMpXnZkw+ bqJgUGMA==; Received: from p4fdb0c34.dip0.t-ipconnect.de ([79.219.12.52] helo=localhost) by casper.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1kKG7I-0003Hv-7w; Mon, 21 Sep 2020 07:20:04 +0000 From: Christoph Hellwig To: Jens Axboe Cc: Josef Bacik , Minchan Kim , Stefan Haberland , Jan Hoeppner , Joseph Qi , "Rafael J. Wysocki" , Pavel Machek , Len Brown , Andrew Morton , linux-kernel@vger.kernel.org, nbd@other.debian.org, linux-ide@vger.kernel.org, linux-s390@vger.kernel.org, linux-fsdevel@vger.kernel.org, ocfs2-devel@oss.oracle.com, linux-pm@vger.kernel.org, linux-mm@kvack.org, linux-block@vger.kernel.org, "Rafael J . Wysocki" Subject: [PATCH 13/14] PM: mm: cleanup swsusp_swap_check Date: Mon, 21 Sep 2020 09:19:57 +0200 Message-Id: <20200921071958.307589-14-hch@lst.de> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200921071958.307589-1-hch@lst.de> References: <20200921071958.307589-1-hch@lst.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use blkdev_get_by_dev instead of bdget + blkdev_get. Signed-off-by: Christoph Hellwig Acked-by: Rafael J. Wysocki --- kernel/power/swap.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/kernel/power/swap.c b/kernel/power/swap.c index 9d3ffbfe08dbf6..71385bedcc3a49 100644 --- a/kernel/power/swap.c +++ b/kernel/power/swap.c @@ -343,12 +343,10 @@ static int swsusp_swap_check(void) return res; root_swap = res; - hib_resume_bdev = bdget(swsusp_resume_device); - if (!hib_resume_bdev) - return -ENOMEM; - res = blkdev_get(hib_resume_bdev, FMODE_WRITE, NULL); - if (res) - return res; + hib_resume_bdev = blkdev_get_by_dev(swsusp_resume_device, FMODE_WRITE, + NULL); + if (IS_ERR(hib_resume_bdev)) + return PTR_ERR(hib_resume_bdev); res = set_blocksize(hib_resume_bdev, PAGE_SIZE); if (res < 0) -- 2.28.0