Skip to content

Commit 46fc75a

Browse files
sadelodunrafaeljw
authored andcommitted
PM: hibernate: Clean up kernel-doc comment style usage
Several static functions in kernel/power/swap.c were described using the kernel-doc comment style (/** ... */) even though they are not exported or referenced by generated documentation. This led to kernel-doc warnings and stylistic inconsistencies. Convert these unnecessary kernel-doc blocks to regular C comments, remove comment blocks that are no longer useful, relocate comments to more appropriate positions where needed, and fix a few "Return:" descriptions that were either missing or incorrectly formatted. No functional changes. Signed-off-by: Sunday Adelodun <adelodunolaoluwa@yahoo.com> [ rjw: Subject adjustment, changelog edits, comment edits ] Link: https://patch.msgid.link/20251114220438.52448-1-adelodunolaoluwa@yahoo.com Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent 37d6d92 commit 46fc75a

1 file changed

Lines changed: 12 additions & 46 deletions

File tree

kernel/power/swap.c

Lines changed: 12 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -336,16 +336,14 @@ static int mark_swapfiles(struct swap_map_handle *handle, unsigned int flags)
336336
*/
337337
unsigned 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-
*/
345339
static 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-
372363
static 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-
534521
static 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-
*/
719700
static 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-
953927
static 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-
974949
int 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-
11251094
static 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-
*/
12381201
static 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-
15691533
int 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-
16071572
int 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
16721638
int swsusp_unmark(void)
16731639
{

0 commit comments

Comments
 (0)