Document missing parameters of various functions to avoid warnings when compiling with W=1. Reported-by: kernel test robot <lkp@xxxxxxxxx> Closes: https://lore.kernel.org/oe-kbuild-all/202502051744.Bjxxm10L-lkp@xxxxxxxxx/ Cc: Sven Schnelle <svens@xxxxxxxxxxxxxx> Signed-off-by: Helge Deller <deller@xxxxxx> diff --git a/kernel/kexec_elf.c b/kernel/kexec_elf.c index d3689632e8b9..f71448ac27c6 100644 --- a/kernel/kexec_elf.c +++ b/kernel/kexec_elf.c @@ -58,6 +58,7 @@ static uint16_t elf16_to_cpu(const struct elfhdr *ehdr, uint16_t value) /** * elf_is_ehdr_sane - check that it is safe to use the ELF header + * @ehdr: pointer to ELF header to be checked. * @buf_len: size of the buffer in which the ELF file is loaded. */ static bool elf_is_ehdr_sane(const struct elfhdr *ehdr, size_t buf_len) @@ -180,7 +181,8 @@ static int elf_read_ehdr(const char *buf, size_t len, struct elfhdr *ehdr) /** * elf_is_phdr_sane - check that it is safe to use the program header - * @buf_len: size of the buffer in which the ELF file is loaded. + * @phdr: pointer to elf_phdr struct to be checked + * @buf_len: size of the buffer in which the ELF file was loaded */ static bool elf_is_phdr_sane(const struct elf_phdr *phdr, size_t buf_len) { @@ -244,6 +246,9 @@ static int elf_read_phdr(const char *buf, size_t len, /** * elf_read_phdrs - read the program headers from the buffer + * @buf: buffer to read ELF file from + * @len: size of @buf + * @elf_info: pointer to existing kexec_elf_info struct which will be populated * * This function assumes that the program header table was checked for sanity. * Use elf_is_ehdr_sane() if it wasn't. @@ -280,10 +285,10 @@ static int elf_read_phdrs(const char *buf, size_t len, /** * elf_read_from_buffer - read ELF file and sets up ELF header and ELF info - * @buf: Buffer to read ELF file from. - * @len: Size of @buf. - * @ehdr: Pointer to existing struct which will be populated. - * @elf_info: Pointer to existing struct which will be populated. + * @buf: buffer to read ELF file from + * @len: size of @buf + * @ehdr: pointer to existing elfhdr struct which will be populated + * @elf_info: pointer to existing kexec_elf_info struct which will be populated * * This function allows reading ELF files with different byte order than * the kernel, byte-swapping the fields as needed. @@ -315,6 +320,8 @@ static int elf_read_from_buffer(const char *buf, size_t len, /** * kexec_free_elf_info - free memory allocated by elf_read_from_buffer + * @elf_info: pointer to existing kexec_elf_info struct which will be freed + * and zeroed. */ void kexec_free_elf_info(struct kexec_elf_info *elf_info) { @@ -322,7 +329,15 @@ void kexec_free_elf_info(struct kexec_elf_info *elf_info) memset(elf_info, 0, sizeof(*elf_info)); } /** - * kexec_build_elf_info - read ELF executable and check that we can use it + * kexec_build_elf_info - read ELF executable headers from buffer and + * check that we can use them + * @buf: buffer to read ELF file from + * @len: size of @buf + * @ehdr: pointer to existing elfhdr struct which will be populated + * @elf_info: pointer to existing kexec_elf_info struct which will be populated + * + * Return: + * 0 on success, negative value on failure. */ int kexec_build_elf_info(const char *buf, size_t len, struct elfhdr *ehdr, struct kexec_elf_info *elf_info) @@ -378,9 +393,15 @@ int kexec_elf_probe(const char *buf, unsigned long len) } /** - * kexec_elf_load - load ELF executable image - * @lowest_load_addr: On return, will be the address where the first PT_LOAD - * section will be loaded in memory. + * kexec_elf_load - load an ELF executable image + * @image: pointer to kimage struct of file to be loaded + * @ehdr: pointer to the ELF header of file to be loaded + * @elf_info: pointer to kexec_elf_info struct of file to be loaded + * @kbuf: pointer to kexec_buf struct which will be used to + * load the ELF file + * @lowest_load_addr: when the kernel was successfully loaded, the address + * where the first PT_LOAD section was loaded is stored + * in the variable pointed to by this pointer * * Return: * 0 on success, negative value on failure.