Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0863dedf authored by Amadeusz Sławiński's avatar Amadeusz Sławiński Committed by Greg Kroah-Hartman
Browse files

PM: hibernate: Remove register_nosave_region_late()



[ 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: default avatarAmadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Reviewed-by: default avatarCezary Rojewski <cezary.rojewski@intel.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 5c5ceea0
Loading
Loading
Loading
Loading
+1 −10
Original line number Diff line number Diff line
@@ -428,15 +428,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 *);
@@ -453,7 +445,6 @@ extern struct pbe *restore_pblist;
int pfn_is_nosave(unsigned long pfn);
#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) {}
+7 −14
Original line number Diff line number Diff line
@@ -945,8 +945,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;

@@ -962,18 +961,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));
	}
	region->start_pfn = start_pfn;
	region->end_pfn = end_pfn;
	list_add_tail(&region->list, &nosave_regions);