Commit e0068315 authored by Shuai Xue's avatar Shuai Xue Committed by Tong Tiangen
Browse files

mm: memory-failure: move return value documentation to function declaration

maillist inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/IB0OV7
CVE: NA

Reference: https://lore.kernel.org/lkml/20241202030527.20586-3-xueshuai@linux.alibaba.com/



----------------------------------------------------------------------

Part of return value comments for memory_failure() were originally
documented at the call site. Move those comments to the function
declaration to improve code readability and to provide developers with
immediate access to function usage and return information.

Signed-off-by: default avatarShuai Xue <xueshuai@linux.alibaba.com>
Reviewed-by: default avatarJarkko Sakkinen <jarkko@kernel.org>
Reviewed-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: default avatarYazen Ghannam <yazen.ghannam@amd.com>

Conflicts:
	arch/x86/kernel/cpu/mce/core.c
	mm/memory-failure.c
[fix context conflicts and memory_failure() return value]
Signed-off-by: default avatarTong Tiangen <tongtiangen@huawei.com>
parent 95b834cf
Loading
Loading
Loading
Loading
+0 −5
Original line number Diff line number Diff line
@@ -1276,11 +1276,6 @@ static void kill_me_maybe(struct callback_head *cb)
		return;
	}

	/*
	 * -EHWPOISON from memory_failure() means that it already sent SIGBUS
	 * to the current process with the proper error info, so no need to
	 * send SIGBUS here again.
	 */
	if (ret == -EHWPOISON)
		return;

+6 −0
Original line number Diff line number Diff line
@@ -1524,6 +1524,12 @@ static int memory_failure_dev_pagemap(unsigned long pfn, int flags,
 *
 * Must run in process context (e.g. a work queue) with interrupts
 * enabled and no spinlocks hold.
 * Return:
 *   0             - success,
 *   -ENXIO        - memory not managed by the kernel
 *   -EHWPOISON    - the page was already poisoned, potentially
 *                   kill process,
 *   other negative values - failure.
 */
int memory_failure(unsigned long pfn, int flags)
{