Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp6014020pxb; Mon, 14 Feb 2022 13:09:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJwbksP0pAee+zaWb/WvAMIJamowW4bAI+URXTbS6iXwvdF/cI6MDoBzW2Zlv0yLaFCBliZi X-Received: by 2002:a63:491d:: with SMTP id w29mr774653pga.366.1644872951729; Mon, 14 Feb 2022 13:09:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644872951; cv=none; d=google.com; s=arc-20160816; b=qpm3qjHC3+qAuhvtXkIciON/D1mLpIA/0DfTxIgfz3vjZDay5HmrncRuyoRVELp8aM ybYAScVWM7KAZ00eekijdfAPyNsvgVk8mZ7GKdkX+GQE18bL2cMD6rxg3QD6ODS7FKfQ fzkUgjojWyaLVYMIsOJ4q5J6DjYt6z35K6r/rBthl3K6UBntX8ADCJAM6PYi3AV8t4m2 doW63OAbuXhr1j1J6woFnzKM/cZamHQBiXNIurWHV4UKLEkpEdW0GI7wSSfWauafej33 Y9x50qf2bm38hKfvGTQBJC7ovT7w89BPli8MlWMg1hT8WNRpCsNqEFVHZNDkRU0fG4hM oj3Q== 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=lwmltxp4OCkF60OMLdDORSRQhmscyxveVh0oRC9CLgY=; b=srQPxT4tAi0RFK2VHGjPNy9UPVJNHt79Me1pCakcl1uqD4LcJxwSym8FPRj+TI0JxK WvLmWdbXpG6ReDudIh9glAAcj4yepzsOLPPpuY6VnuV6ykpVZAQu8yvsZr2sGpVkb9FL Tw92QcSofATrGnERYaf/0KSCL6tdpm5KZZn8VJQup1zGFGYaJzqsFby44qETF+cVjNT/ Ked8U22K6Zydkh6mfZkGmZGGCBbFP0LckSLwC6eBsoKfsaeDeyGtIwZdWlAFhVYBlzMl jIns6RD3Q14az/VVOuu1FQXevlef6uBK57GnId/0ELYScwud1YrTV1uFSSl2jSkeOvjv 6/JA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=lUC2f7GR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id h62si714606pge.815.2022.02.14.13.09.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Feb 2022 13:09:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=lUC2f7GR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id E1D6018D21C; Mon, 14 Feb 2022 12:29:29 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238815AbiBNKEX (ORCPT + 99 others); Mon, 14 Feb 2022 05:04:23 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:44920 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344348AbiBNJ72 (ORCPT ); Mon, 14 Feb 2022 04:59:28 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5F354C34; Mon, 14 Feb 2022 01:47: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 1E7E6B80DBF; Mon, 14 Feb 2022 09:46:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2B12AC340E9; Mon, 14 Feb 2022 09:46:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1644832017; bh=L2abX2J6L4mBx7bs32Xn/5k1qnjftTG1FoPZV+6UUe4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lUC2f7GRnf4l4xH1I3+X+8rqAgKaNkMbbOtl01RVIFkliCJgpkgRg5PijcAMTW5qL KgBnU6Yol270DHDeqGw8X49gu1bTQm2C8NNwm5WD63NUCcTyKFRoSdVq7qGR7yKSqn C7EBa1MbXc3zRV4b0d+xGwaeMbMhQ47BwxWL81gI= 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.15 053/172] PM: hibernate: Remove register_nosave_region_late() Date: Mon, 14 Feb 2022 10:25:11 +0100 Message-Id: <20220214092508.220560042@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220214092506.354292783@linuxfoundation.org> References: <20220214092506.354292783@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=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 f7a9860782135..330d499376924 100644 --- a/kernel/power/snapshot.c +++ b/kernel/power/snapshot.c @@ -978,8 +978,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; @@ -995,18 +994,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