/* mark_unsafe_pages - mark the pages that cannot be used for storing the image during resume, because they conflict with the pages that had been used before suspend  */
static int mark_unsafe_pages(struct memory_bitmap *bm)
/* mark_unsafe_pages - mark the pages that cannot be used for storing the image during resume, because they conflict with the pages that had been used before suspend  */
static int mark_unsafe_pages(struct memory_bitmap *bm)
{
	struct zone *zone;
	unsigned long pfn, max_zone_pfn;
	for_each_populated_zone(zone) {
		max_zone_pfn = zone->zone_start_pfn + zone->spanned_pages;
		for (pfn = zone->zone_start_pfn; pfn < max_zone_pfn; pfn++)
			if (pfn_valid(pfn))
				swsusp_unset_page_free(pfn_to_page(pfn));
	}
	memory_bm_position_reset(bm);
	do {
		pfn = memory_bm_next_pfn(bm);
		if (likely(pfn != BM_END_OF_MAP)) {
			if (likely(pfn_valid(pfn)))
				swsusp_set_page_free(pfn_to_page(pfn));
			else
				return -EFAULT;
		}
	} while (pfn != BM_END_OF_MAP);
	allocated_unsafe_pages = 0;
	return 0;
}