Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp5788426pxb; Mon, 14 Feb 2022 07:39:29 -0800 (PST) X-Google-Smtp-Source: ABdhPJxh+LxlDYJjk+MOHBVZ6TVv6iu4VmF+vC7IwCctxkzKiKbaev7irYblShsTaIMniqXD8Xms X-Received: by 2002:a17:90b:38cc:: with SMTP id nn12mr15314016pjb.228.1644853168729; Mon, 14 Feb 2022 07:39:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644853168; cv=none; d=google.com; s=arc-20160816; b=CBlyh3D7ityWKoPXYLJ/OeCEFsIXyJSdq9OTn/60X6iyqIMtx133+HZzmltP6J7u9y DqfKSKud0rm13BxbBqSLaPMiUwbGPvUkIfsedetsP94oOXOs6mmL0G1s4leoeIb6OqLW OautwlO7lf4AErHDMccF7b8qc+N7bvciQD/7QQKjHxm754WXvg9pBxQ71I3nAAga6M0P Tv7gJu8erkFuWUnGdjpwZC+gBe31CvKFfqxbHidgOMMbU+S/l/zTO7bhMJe/d9hXTs0b 5/dSZ5bxY4vXZpOGD2sQ5dkdAa++MJXsXlX95rfVVRcT+vhsbp0v1D11ihUk2gnwoLJ2 Bz/g== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=dDHUSDYjprFLtQokWnGe6uk4J0Pvx4IKA6tK0h0B8+8=; b=m/aQQRA8Rckp63Y9H/n/sJumZwvrLBF8fndhLVZceCMWTHZCxd44hAVdd7pvn0hGUa rt2+J26Z+tu6vxOAlpeAPNOeVrclHOYj04JiWHvn6F6BPdS7Qy4jfxcrg392r9VAXmW1 I2WsaHzwVy8D4r8WmbgPmF11IXbRDMa8gvJw0QTAn4rEjKFIMREk/YhdW2F0uBPSSi9B 0pJoriez6jC0sxaTnToq4e39BfMaxyBnU8iT05Ed5gnJALhO+S7EZRHIA4/GE5hdvuJP S9toAPXdPNCGf+0E1LNoovvpVTROhpELCKVvkrnNfkqsoV6gtxldKljtcbezo7KxHD0A kFWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=gyn1zm8f; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v9si14510379plg.616.2022.02.14.07.39.12; Mon, 14 Feb 2022 07:39:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=gyn1zm8f; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245377AbiBNJtY (ORCPT + 99 others); Mon, 14 Feb 2022 04:49:24 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:42958 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343846AbiBNJqa (ORCPT ); Mon, 14 Feb 2022 04:46:30 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D932D69CCA; Mon, 14 Feb 2022 01:40:00 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 9061FB80DC7; Mon, 14 Feb 2022 09:39:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8A7B6C340E9; Mon, 14 Feb 2022 09:39:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1644831598; bh=ojmiylI0YjC8wN3pyGRx1nGh82RjVji27PqBngnvtws=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gyn1zm8fFw8lMX5yQG6thwUX1e9H24jyz+GNkttteyJm/2q1uY5ID2GBBqq7oTXJt 07NHw0QQxzsKvl5ikXcv89pcPh0+O1dFH1KZY3Dur/Gfh1YYyo7dWaHZlZoiYmKhIN 3NjqbcTHk3/bNXmVOU7aKpC74O9sih7wxme5yjdg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?UTF-8?q?Amadeusz=20S=C5=82awi=C5=84ski?= , Cezary Rojewski , "Rafael J. Wysocki" , Sasha Levin Subject: [PATCH 5.10 032/116] PM: hibernate: Remove register_nosave_region_late() Date: Mon, 14 Feb 2022 10:25:31 +0100 Message-Id: <20220214092459.800350010@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220214092458.668376521@linuxfoundation.org> References: <20220214092458.668376521@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Amadeusz Sławiński [ Upstream commit 33569ef3c754a82010f266b7b938a66a3ccf90a4 ] It is an unused wrapper forcing kmalloc allocation for registering nosave regions. Also, rename __register_nosave_region() to register_nosave_region() now that there is no need for disambiguation. Signed-off-by: Amadeusz Sławiński Reviewed-by: Cezary Rojewski Signed-off-by: Rafael J. Wysocki Signed-off-by: Sasha Levin --- include/linux/suspend.h | 11 +---------- kernel/power/snapshot.c | 21 +++++++-------------- 2 files changed, 8 insertions(+), 24 deletions(-) diff --git a/include/linux/suspend.h b/include/linux/suspend.h index 8af13ba60c7e4..c1310c571d805 100644 --- a/include/linux/suspend.h +++ b/include/linux/suspend.h @@ -430,15 +430,7 @@ struct platform_hibernation_ops { #ifdef CONFIG_HIBERNATION /* kernel/power/snapshot.c */ -extern void __register_nosave_region(unsigned long b, unsigned long e, int km); -static inline void __init register_nosave_region(unsigned long b, unsigned long e) -{ - __register_nosave_region(b, e, 0); -} -static inline void __init register_nosave_region_late(unsigned long b, unsigned long e) -{ - __register_nosave_region(b, e, 1); -} +extern void register_nosave_region(unsigned long b, unsigned long e); extern int swsusp_page_is_forbidden(struct page *); extern void swsusp_set_page_free(struct page *); extern void swsusp_unset_page_free(struct page *); @@ -457,7 +449,6 @@ int pfn_is_nosave(unsigned long pfn); int hibernate_quiet_exec(int (*func)(void *data), void *data); #else /* CONFIG_HIBERNATION */ static inline void register_nosave_region(unsigned long b, unsigned long e) {} -static inline void register_nosave_region_late(unsigned long b, unsigned long e) {} static inline int swsusp_page_is_forbidden(struct page *p) { return 0; } static inline void swsusp_set_page_free(struct page *p) {} static inline void swsusp_unset_page_free(struct page *p) {} diff --git a/kernel/power/snapshot.c b/kernel/power/snapshot.c index 46b1804c1ddf7..1da013f50059a 100644 --- a/kernel/power/snapshot.c +++ b/kernel/power/snapshot.c @@ -944,8 +944,7 @@ static void memory_bm_recycle(struct memory_bitmap *bm) * Register a range of page frames the contents of which should not be saved * during hibernation (to be used in the early initialization code). */ -void __init __register_nosave_region(unsigned long start_pfn, - unsigned long end_pfn, int use_kmalloc) +void __init register_nosave_region(unsigned long start_pfn, unsigned long end_pfn) { struct nosave_region *region; @@ -961,18 +960,12 @@ void __init __register_nosave_region(unsigned long start_pfn, goto Report; } } - if (use_kmalloc) { - /* During init, this shouldn't fail */ - region = kmalloc(sizeof(struct nosave_region), GFP_KERNEL); - BUG_ON(!region); - } else { - /* This allocation cannot fail */ - region = memblock_alloc(sizeof(struct nosave_region), - SMP_CACHE_BYTES); - if (!region) - panic("%s: Failed to allocate %zu bytes\n", __func__, - sizeof(struct nosave_region)); - } + /* This allocation cannot fail */ + region = memblock_alloc(sizeof(struct nosave_region), + SMP_CACHE_BYTES); + if (!region) + panic("%s: Failed to allocate %zu bytes\n", __func__, + sizeof(struct nosave_region)); region->start_pfn = start_pfn; region->end_pfn = end_pfn; list_add_tail(®ion->list, &nosave_regions); -- 2.34.1