Commit efd5a852 authored by Rafael J. Wysocki's avatar Rafael J. Wysocki

PM / hibernate: Clean up function headers in snapshot.c

The formatting of some function headers in kernel/power/snapshot.c
is not consistent with the general kernel coding style and with the
formatting of some other function headers in the same file.

Make all of them follow the same formatting convention.

No functional changes.
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 2f88e41a
...@@ -186,8 +186,8 @@ static inline void free_image_page(void *addr, int clear_nosave_free) ...@@ -186,8 +186,8 @@ static inline void free_image_page(void *addr, int clear_nosave_free)
__free_page(page); __free_page(page);
} }
static inline void static inline void free_list_of_pages(struct linked_page *list,
free_list_of_pages(struct linked_page *list, int clear_page_nosave) int clear_page_nosave)
{ {
while (list) { while (list) {
struct linked_page *lp = list->next; struct linked_page *lp = list->next;
...@@ -219,8 +219,8 @@ struct chain_allocator { ...@@ -219,8 +219,8 @@ struct chain_allocator {
int safe_needed; /* if set, only "safe" pages are allocated */ int safe_needed; /* if set, only "safe" pages are allocated */
}; };
static void static void chain_init(struct chain_allocator *ca, gfp_t gfp_mask,
chain_init(struct chain_allocator *ca, gfp_t gfp_mask, int safe_needed) int safe_needed)
{ {
ca->chain = NULL; ca->chain = NULL;
ca->used_space = LINKED_PAGE_DATA_SIZE; ca->used_space = LINKED_PAGE_DATA_SIZE;
...@@ -452,10 +452,11 @@ static void free_zone_bm_rtree(struct mem_zone_bm_rtree *zone, ...@@ -452,10 +452,11 @@ static void free_zone_bm_rtree(struct mem_zone_bm_rtree *zone,
* This function also allocated and builds the radix tree for the * This function also allocated and builds the radix tree for the
* zone. * zone.
*/ */
static struct mem_zone_bm_rtree * static struct mem_zone_bm_rtree *create_zone_bm_rtree(gfp_t gfp_mask,
create_zone_bm_rtree(gfp_t gfp_mask, int safe_needed, int safe_needed,
struct chain_allocator *ca, struct chain_allocator *ca,
unsigned long start, unsigned long end) unsigned long start,
unsigned long end)
{ {
struct mem_zone_bm_rtree *zone; struct mem_zone_bm_rtree *zone;
unsigned int i, nr_blocks; unsigned int i, nr_blocks;
...@@ -595,8 +596,8 @@ static int create_mem_extents(struct list_head *list, gfp_t gfp_mask) ...@@ -595,8 +596,8 @@ static int create_mem_extents(struct list_head *list, gfp_t gfp_mask)
/** /**
* memory_bm_create - allocate memory for a memory bitmap * memory_bm_create - allocate memory for a memory bitmap
*/ */
static int static int memory_bm_create(struct memory_bitmap *bm, gfp_t gfp_mask,
memory_bm_create(struct memory_bitmap *bm, gfp_t gfp_mask, int safe_needed) int safe_needed)
{ {
struct chain_allocator ca; struct chain_allocator ca;
struct list_head mem_extents; struct list_head mem_extents;
...@@ -894,9 +895,8 @@ static void memory_bm_recycle(struct memory_bitmap *bm) ...@@ -894,9 +895,8 @@ static void memory_bm_recycle(struct memory_bitmap *bm)
* initialization code) * initialization code)
*/ */
void __init void __init __register_nosave_region(unsigned long start_pfn,
__register_nosave_region(unsigned long start_pfn, unsigned long end_pfn, unsigned long end_pfn, int use_kmalloc)
int use_kmalloc)
{ {
struct nosave_region *region; struct nosave_region *region;
...@@ -1277,8 +1277,7 @@ static void safe_copy_page(void *dst, struct page *s_page) ...@@ -1277,8 +1277,7 @@ static void safe_copy_page(void *dst, struct page *s_page)
#ifdef CONFIG_HIGHMEM #ifdef CONFIG_HIGHMEM
static inline struct page * static inline struct page *page_is_saveable(struct zone *zone, unsigned long pfn)
page_is_saveable(struct zone *zone, unsigned long pfn)
{ {
return is_highmem(zone) ? return is_highmem(zone) ?
saveable_highmem_page(zone, pfn) : saveable_page(zone, pfn); saveable_highmem_page(zone, pfn) : saveable_page(zone, pfn);
...@@ -1321,8 +1320,8 @@ static inline void copy_data_page(unsigned long dst_pfn, unsigned long src_pfn) ...@@ -1321,8 +1320,8 @@ static inline void copy_data_page(unsigned long dst_pfn, unsigned long src_pfn)
} }
#endif /* CONFIG_HIGHMEM */ #endif /* CONFIG_HIGHMEM */
static void static void copy_data_pages(struct memory_bitmap *copy_bm,
copy_data_pages(struct memory_bitmap *copy_bm, struct memory_bitmap *orig_bm) struct memory_bitmap *orig_bm)
{ {
struct zone *zone; struct zone *zone;
unsigned long pfn; unsigned long pfn;
...@@ -1485,8 +1484,8 @@ static unsigned long __fraction(u64 x, u64 multiplier, u64 base) ...@@ -1485,8 +1484,8 @@ static unsigned long __fraction(u64 x, u64 multiplier, u64 base)
} }
static unsigned long preallocate_highmem_fraction(unsigned long nr_pages, static unsigned long preallocate_highmem_fraction(unsigned long nr_pages,
unsigned long highmem, unsigned long highmem,
unsigned long total) unsigned long total)
{ {
unsigned long alloc = __fraction(nr_pages, highmem, total); unsigned long alloc = __fraction(nr_pages, highmem, total);
...@@ -1499,8 +1498,8 @@ static inline unsigned long preallocate_image_highmem(unsigned long nr_pages) ...@@ -1499,8 +1498,8 @@ static inline unsigned long preallocate_image_highmem(unsigned long nr_pages)
} }
static inline unsigned long preallocate_highmem_fraction(unsigned long nr_pages, static inline unsigned long preallocate_highmem_fraction(unsigned long nr_pages,
unsigned long highmem, unsigned long highmem,
unsigned long total) unsigned long total)
{ {
return 0; return 0;
} }
...@@ -1780,8 +1779,7 @@ static unsigned int count_pages_for_highmem(unsigned int nr_highmem) ...@@ -1780,8 +1779,7 @@ static unsigned int count_pages_for_highmem(unsigned int nr_highmem)
return nr_highmem; return nr_highmem;
} }
#else #else
static unsigned int static unsigned int count_pages_for_highmem(unsigned int nr_highmem) { return 0; }
count_pages_for_highmem(unsigned int nr_highmem) { return 0; }
#endif /* CONFIG_HIGHMEM */ #endif /* CONFIG_HIGHMEM */
/** /**
...@@ -1823,8 +1821,8 @@ static inline int get_highmem_buffer(int safe_needed) ...@@ -1823,8 +1821,8 @@ static inline int get_highmem_buffer(int safe_needed)
* highmem pages is lesser than that, allocate them all. * highmem pages is lesser than that, allocate them all.
*/ */
static inline unsigned int static inline unsigned int alloc_highmem_pages(struct memory_bitmap *bm,
alloc_highmem_pages(struct memory_bitmap *bm, unsigned int nr_highmem) unsigned int nr_highmem)
{ {
unsigned int to_alloc = count_free_highmem_pages(); unsigned int to_alloc = count_free_highmem_pages();
...@@ -1843,8 +1841,8 @@ alloc_highmem_pages(struct memory_bitmap *bm, unsigned int nr_highmem) ...@@ -1843,8 +1841,8 @@ alloc_highmem_pages(struct memory_bitmap *bm, unsigned int nr_highmem)
#else #else
static inline int get_highmem_buffer(int safe_needed) { return 0; } static inline int get_highmem_buffer(int safe_needed) { return 0; }
static inline unsigned int static inline unsigned int alloc_highmem_pages(struct memory_bitmap *bm,
alloc_highmem_pages(struct memory_bitmap *bm, unsigned int n) { return 0; } unsigned int n) { return 0; }
#endif /* CONFIG_HIGHMEM */ #endif /* CONFIG_HIGHMEM */
/** /**
...@@ -1859,9 +1857,9 @@ alloc_highmem_pages(struct memory_bitmap *bm, unsigned int n) { return 0; } ...@@ -1859,9 +1857,9 @@ alloc_highmem_pages(struct memory_bitmap *bm, unsigned int n) { return 0; }
* copy_data_pages() works. * copy_data_pages() works.
*/ */
static int static int swsusp_alloc(struct memory_bitmap *orig_bm,
swsusp_alloc(struct memory_bitmap *orig_bm, struct memory_bitmap *copy_bm, struct memory_bitmap *copy_bm,
unsigned int nr_pages, unsigned int nr_highmem) unsigned int nr_pages, unsigned int nr_highmem)
{ {
if (nr_highmem > 0) { if (nr_highmem > 0) {
if (get_highmem_buffer(PG_ANY)) if (get_highmem_buffer(PG_ANY))
...@@ -1978,8 +1976,7 @@ static int init_header(struct swsusp_info *info) ...@@ -1978,8 +1976,7 @@ static int init_header(struct swsusp_info *info)
* are stored in the array @buf[] (1 page at a time) * are stored in the array @buf[] (1 page at a time)
*/ */
static inline void static inline void pack_pfns(unsigned long *buf, struct memory_bitmap *bm)
pack_pfns(unsigned long *buf, struct memory_bitmap *bm)
{ {
int j; int j;
...@@ -2110,8 +2107,7 @@ static int check_header(struct swsusp_info *info) ...@@ -2110,8 +2107,7 @@ static int check_header(struct swsusp_info *info)
* load header - check the image header and copy data from it * load header - check the image header and copy data from it
*/ */
static int static int load_header(struct swsusp_info *info)
load_header(struct swsusp_info *info)
{ {
int error; int error;
...@@ -2204,8 +2200,8 @@ static unsigned int safe_highmem_pages; ...@@ -2204,8 +2200,8 @@ static unsigned int safe_highmem_pages;
static struct memory_bitmap *safe_highmem_bm; static struct memory_bitmap *safe_highmem_bm;
static int static int prepare_highmem_image(struct memory_bitmap *bm,
prepare_highmem_image(struct memory_bitmap *bm, unsigned int *nr_highmem_p) unsigned int *nr_highmem_p)
{ {
unsigned int to_alloc; unsigned int to_alloc;
...@@ -2259,8 +2255,8 @@ prepare_highmem_image(struct memory_bitmap *bm, unsigned int *nr_highmem_p) ...@@ -2259,8 +2255,8 @@ prepare_highmem_image(struct memory_bitmap *bm, unsigned int *nr_highmem_p)
static struct page *last_highmem_page; static struct page *last_highmem_page;
static void * static void *get_highmem_page_buffer(struct page *page,
get_highmem_page_buffer(struct page *page, struct chain_allocator *ca) struct chain_allocator *ca)
{ {
struct highmem_pbe *pbe; struct highmem_pbe *pbe;
void *kaddr; void *kaddr;
...@@ -2333,17 +2329,13 @@ static inline void free_highmem_data(void) ...@@ -2333,17 +2329,13 @@ static inline void free_highmem_data(void)
free_image_page(buffer, PG_UNSAFE_CLEAR); free_image_page(buffer, PG_UNSAFE_CLEAR);
} }
#else #else
static unsigned int static unsigned int count_highmem_image_pages(struct memory_bitmap *bm) { return 0; }
count_highmem_image_pages(struct memory_bitmap *bm) { return 0; }
static inline int static inline int prepare_highmem_image(struct memory_bitmap *bm,
prepare_highmem_image(struct memory_bitmap *bm, unsigned int *nr_highmem_p) unsigned int *nr_highmem_p) { return 0; }
{
return 0;
}
static inline void * static inline void *get_highmem_page_buffer(struct page *page,
get_highmem_page_buffer(struct page *page, struct chain_allocator *ca) struct chain_allocator *ca)
{ {
return ERR_PTR(-EINVAL); return ERR_PTR(-EINVAL);
} }
...@@ -2369,8 +2361,7 @@ static inline void free_highmem_data(void) {} ...@@ -2369,8 +2361,7 @@ static inline void free_highmem_data(void) {}
#define PBES_PER_LINKED_PAGE (LINKED_PAGE_DATA_SIZE / sizeof(struct pbe)) #define PBES_PER_LINKED_PAGE (LINKED_PAGE_DATA_SIZE / sizeof(struct pbe))
static int static int prepare_image(struct memory_bitmap *new_bm, struct memory_bitmap *bm)
prepare_image(struct memory_bitmap *new_bm, struct memory_bitmap *bm)
{ {
unsigned int nr_pages, nr_highmem; unsigned int nr_pages, nr_highmem;
struct linked_page *lp; struct linked_page *lp;
...@@ -2593,8 +2584,8 @@ int snapshot_image_loaded(struct snapshot_handle *handle) ...@@ -2593,8 +2584,8 @@ int snapshot_image_loaded(struct snapshot_handle *handle)
#ifdef CONFIG_HIGHMEM #ifdef CONFIG_HIGHMEM
/* Assumes that @buf is ready and points to a "safe" page */ /* Assumes that @buf is ready and points to a "safe" page */
static inline void static inline void swap_two_pages_data(struct page *p1, struct page *p2,
swap_two_pages_data(struct page *p1, struct page *p2, void *buf) void *buf)
{ {
void *kaddr1, *kaddr2; void *kaddr1, *kaddr2;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment