@@ -336,16 +336,14 @@ static int mark_swapfiles(struct swap_map_handle *handle, unsigned int flags)
336336 */
337337unsigned int swsusp_header_flags ;
338338
339- /**
340- * swsusp_swap_check - check if the resume device is a swap device
341- * and get its index (if so)
342- *
343- * This is called before saving image
344- */
345339static int swsusp_swap_check (void )
346340{
347341 int res ;
348342
343+ /*
344+ * Check if the resume device is a swap device and get its index (if so).
345+ * This is called before saving the image.
346+ */
349347 if (swsusp_resume_device )
350348 res = swap_type_of (swsusp_resume_device , swsusp_resume_block );
351349 else
@@ -362,13 +360,6 @@ static int swsusp_swap_check(void)
362360 return 0 ;
363361}
364362
365- /**
366- * write_page - Write one page to given swap location.
367- * @buf: Address we're writing.
368- * @offset: Offset of the swap page we're writing to.
369- * @hb: bio completion batch
370- */
371-
372363static int write_page (void * buf , sector_t offset , struct hib_bio_batch * hb )
373364{
374365 gfp_t gfp = GFP_NOIO | __GFP_NOWARN | __GFP_NORETRY ;
@@ -527,10 +518,6 @@ static unsigned int hibernate_compression_threads = CMP_THREADS;
527518#define CMP_MIN_RD_PAGES 1024
528519#define CMP_MAX_RD_PAGES 8192
529520
530- /**
531- * save_image - save the suspend image data
532- */
533-
534521static int save_image (struct swap_map_handle * handle ,
535522 struct snapshot_handle * snapshot ,
536523 unsigned int nr_to_write )
@@ -710,12 +697,6 @@ static int compress_threadfn(void *data)
710697 return 0 ;
711698}
712699
713- /**
714- * save_compressed_image - Save the suspend image data after compression.
715- * @handle: Swap map handle to use for saving the image.
716- * @snapshot: Image to read data from.
717- * @nr_to_write: Number of pages to save.
718- */
719700static int save_compressed_image (struct swap_map_handle * handle ,
720701 struct snapshot_handle * snapshot ,
721702 unsigned int nr_to_write )
@@ -943,13 +924,6 @@ static int save_compressed_image(struct swap_map_handle *handle,
943924 return ret ;
944925}
945926
946- /**
947- * enough_swap - Make sure we have enough swap to save the image.
948- *
949- * Returns TRUE or FALSE after checking the total amount of swap
950- * space available from the resume partition.
951- */
952-
953927static int enough_swap (unsigned int nr_pages )
954928{
955929 unsigned int free_swap = count_swap_pages (root_swap , 1 );
@@ -969,8 +943,9 @@ static int enough_swap(unsigned int nr_pages)
969943 * them synced (in case something goes wrong) but we DO not want to mark
970944 * filesystem clean: it is not. (And it does not matter, if we resume
971945 * correctly, we'll mark system clean, anyway.)
946+ *
947+ * Return: 0 on success, negative error code on failure.
972948 */
973-
974949int swsusp_write (unsigned int flags )
975950{
976951 struct swap_map_handle handle ;
@@ -1116,12 +1091,6 @@ static int swap_reader_finish(struct swap_map_handle *handle)
11161091 return 0 ;
11171092}
11181093
1119- /**
1120- * load_image - load the image using the swap map handle
1121- * @handle and the snapshot handle @snapshot
1122- * (assume there are @nr_pages pages to load)
1123- */
1124-
11251094static int load_image (struct swap_map_handle * handle ,
11261095 struct snapshot_handle * snapshot ,
11271096 unsigned int nr_to_read )
@@ -1229,12 +1198,6 @@ static int decompress_threadfn(void *data)
12291198 return 0 ;
12301199}
12311200
1232- /**
1233- * load_compressed_image - Load compressed image data and decompress it.
1234- * @handle: Swap map handle to use for loading data.
1235- * @snapshot: Image to copy uncompressed data into.
1236- * @nr_to_read: Number of pages to load.
1237- */
12381201static int load_compressed_image (struct swap_map_handle * handle ,
12391202 struct snapshot_handle * snapshot ,
12401203 unsigned int nr_to_read )
@@ -1564,8 +1527,9 @@ static int load_compressed_image(struct swap_map_handle *handle,
15641527 * swsusp_read - read the hibernation image.
15651528 * @flags_p: flags passed by the "frozen" kernel in the image header should
15661529 * be written into this memory location
1530+ *
1531+ * Return: 0 on success, negative error code on failure.
15671532 */
1568-
15691533int swsusp_read (unsigned int * flags_p )
15701534{
15711535 int error ;
@@ -1602,8 +1566,9 @@ static void *swsusp_holder;
16021566/**
16031567 * swsusp_check - Open the resume device and check for the swsusp signature.
16041568 * @exclusive: Open the resume device exclusively.
1569+ *
1570+ * Return: 0 if a valid image is found, negative error code otherwise.
16051571 */
1606-
16071572int swsusp_check (bool exclusive )
16081573{
16091574 void * holder = exclusive ? & swsusp_holder : NULL ;
@@ -1666,8 +1631,9 @@ void swsusp_close(void)
16661631
16671632/**
16681633 * swsusp_unmark - Unmark swsusp signature in the resume device
1634+ *
1635+ * Return: 0 on success, negative error code on failure.
16691636 */
1670-
16711637#ifdef CONFIG_SUSPEND
16721638int swsusp_unmark (void )
16731639{
0 commit comments