From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 55E34D21269 for ; Thu, 17 Oct 2024 09:42:05 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E04F16B0082; Thu, 17 Oct 2024 05:42:04 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id DB4B46B0088; Thu, 17 Oct 2024 05:42:04 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CA3516B008A; Thu, 17 Oct 2024 05:42:04 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id AC66E6B0082 for ; Thu, 17 Oct 2024 05:42:04 -0400 (EDT) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id C057EC0FD4 for ; Thu, 17 Oct 2024 09:41:52 +0000 (UTC) X-FDA: 82682602674.26.0803E24 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by imf14.hostedemail.com (Postfix) with ESMTP id 4A767100010 for ; Thu, 17 Oct 2024 09:41:51 +0000 (UTC) Authentication-Results: imf14.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf14.hostedemail.com: domain of jonathan.cameron@huawei.com designates 185.176.79.56 as permitted sender) smtp.mailfrom=jonathan.cameron@huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1729157978; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Mps0bs/ZEBOlrL4is6Y6vLgbAds5eEjz2jlcLkOzP6w=; b=ZRCDmeP42VH/xK7+gqWoZp1HeQOnL2ktBQnD92i7QoxndTCpXRDBdywhmQy/jtK6gqiUSk G83Hv9wW/TVzIcq4J4HdYA2ZQD9yNTtDuxN0P3FgPw6w0HwtbU9Wwn+B5uw8f4UqSIvvAe 8wHp1MhyDD3sqcoZ0cMUroJZCUvLGEs= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1729157978; a=rsa-sha256; cv=none; b=icnRKM86/ycqHIVBi16lHmQXBVfgW71EjP5qMn5OgkJnBNLoyiXvUU4zxFo0kRmnlNGw7N xw9odh9mcLdd7jFwOdymwJ0lNaXlMkimo8lpca6PHE/L6cIuDpK/wIQgz1MhSAQaJF0gBI OiwgnIPYKbzz1FGSrhVs6f1wp9GisiY= ARC-Authentication-Results: i=1; imf14.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf14.hostedemail.com: domain of jonathan.cameron@huawei.com designates 185.176.79.56 as permitted sender) smtp.mailfrom=jonathan.cameron@huawei.com Received: from mail.maildlp.com (unknown [172.18.186.231]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4XTjVm4yCrz6G9bw; Thu, 17 Oct 2024 17:40:16 +0800 (CST) Received: from frapeml500008.china.huawei.com (unknown [7.182.85.71]) by mail.maildlp.com (Postfix) with ESMTPS id 5A3971400DB; Thu, 17 Oct 2024 17:42:00 +0800 (CST) Received: from localhost (10.126.174.164) by frapeml500008.china.huawei.com (7.182.85.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Thu, 17 Oct 2024 11:41:58 +0200 Date: Thu, 17 Oct 2024 10:41:56 +0100 From: Jonathan Cameron To: Shuai Xue CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: Re: [PATCH v14 2/3] mm: memory-failure: move return value documentation to function declaration Message-ID: <20241017104156.00000f83@Huawei.com> In-Reply-To: <20241014084240.18614-3-xueshuai@linux.alibaba.com> References: <20221027042445.60108-1-xueshuai@linux.alibaba.com> <20241014084240.18614-3-xueshuai@linux.alibaba.com> Organization: Huawei Technologies Research and Development (UK) Ltd. X-Mailer: Claws Mail 4.1.0 (GTK 3.24.33; x86_64-w64-mingw32) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.126.174.164] X-ClientProxiedBy: lhrpeml100003.china.huawei.com (7.191.160.210) To frapeml500008.china.huawei.com (7.182.85.71) X-Rspamd-Queue-Id: 4A767100010 X-Stat-Signature: jbcaamoo8qkqp57g3ttqxcahqb3ss3j8 X-Rspamd-Server: rspam09 X-Rspam-User: X-HE-Tag: 1729158110-299243 X-HE-Meta: U2FsdGVkX1/nsl/A2TAjqH8R/JNXzBvMRGn1aF5h76kLhQQblQHDLId6/OsDNXZbuS74gstnQ63sjS0J9DqSKmNJv8Vhcw0khSUx6Zgvw2NcNPjHFB3dQl8GflDAWZ+mwSgTpHyTC/PuoF3a4/THkDCjOxMD3zE61Rx9Po1Sk30vgBQ+1JNzZoI1h29TmkqDLGRXQFLs+obNYXn+WuEHEuP1myz001aC8ZmpJRibUlDbv0XvAvco+st/P0AAdPNX2EtUZz+Q9BPXLe4CZtfjeHGxyaQ/HdbzxxahU7GIGeQX/soN7vIrOP+L81nc0ofmDYmxNo/WwUXcDt8a3LnJwYvfvLUr/3NXGQZLRgPu7FxqSjKUE8zQ2M/Tif0Uyu+w0NeqO4zX3/TMQKGsqWzb7ScqhYhwOHia09LWQ7DnEWwkeCq4hBqrU+odKvEnJ3lLzUjCFBuhSRnVXeyQTchdgwBAoxkcM++er0j2p7MV0kwDwzYQBhoyUuRdqZuom01lXF9HUytTLnyfXGFpfD9Bo0shVNqS5V9euf1LoxWadY9ztoAwne9oSKIH+pxO6M5cIhGJXSiwlUnVHZvK1VkhMBRzgfc12gTkwM+L4rDXpt+U3E1OaIhsKWPFnapOcpJo5ZnpQpcTlMxqQ+26BOObLHA4IMy+St2ooPfTqLT8SbVmp5SfCmHn0/9j2sydf/SYeKFKavnHE4rYcExOffUjnpc6WBDVBxbLExrQqo6ywqZfEV0uB6T0V2rQjLauMKXo1Xg2kKEgnoBk0RGKkhIQ2tsmpK4Ad4Z48y+FGITg+GSNde8SlH02FlpHgZ2jwTGi+IouOis5IepmdyXyLAcW2dNDiHMHslxw3bPaSaKNmGpcO1T1hPSidL7+52wymdznezUXIeRpE1pp2j5XmL52bGWjE8EHka7bPMe7VJexw7PnK8usw6kxPB+wA2I/V44GkY8dDOk7ZVKcyIOZ5LR lXHg9S3C YKsRKIl2erHlsld2eQnC/ZU0SbfoBxCSZujMCnemdds+0xNmysyRE4582V3JOaYhkZoBsWPNnxfwQDERe4Ql7yDZFiOMHSCW4ktjGA63vLXN5zliKKbgNKzphOcr9ZXHV6Z+g/3+KOfttrGFli6Vg+ID//dY0YytH1IAK0Odqy+C3atLLcaKdlkrjjc4hfp8DVncVUr3jE2n/MWK+UojPVVVEpaeMuVGKykSZu6vEEkBK0yoNQcoAReBJ2OKGfnaQ2/Te/Roi22NPUbGCAkOVs0U4sA== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Mon, 14 Oct 2024 16:42:39 +0800 Shuai Xue wrote: > 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: Shuai Xue > Reviewed-by: Jarkko Sakkinen Seems sensible. Reviewed-by: Jonathan Cameron > --- > arch/x86/kernel/cpu/mce/core.c | 7 ------- > mm/memory-failure.c | 9 ++++++--- > 2 files changed, 6 insertions(+), 10 deletions(-) > > diff --git a/arch/x86/kernel/cpu/mce/core.c b/arch/x86/kernel/cpu/mce/core.c > index 2a938f429c4d..c90d8fcd246a 100644 > --- a/arch/x86/kernel/cpu/mce/core.c > +++ b/arch/x86/kernel/cpu/mce/core.c > @@ -1373,13 +1373,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, > - * -EOPNOTSUPP means hwpoison_filter() filtered the error event, > - * > - * In both cases, no further processing is required. > - */ > if (ret == -EHWPOISON || ret == -EOPNOTSUPP) > return; > > diff --git a/mm/memory-failure.c b/mm/memory-failure.c > index 96ce31e5a203..1c5098f32d48 100644 > --- a/mm/memory-failure.c > +++ b/mm/memory-failure.c > @@ -2209,9 +2209,12 @@ static void kill_procs_now(struct page *p, unsigned long pfn, int flags, > * Must run in process context (e.g. a work queue) with interrupts > * enabled and no spinlocks held. > * > - * Return: 0 for successfully handled the memory error, > - * -EOPNOTSUPP for hwpoison_filter() filtered the error event, > - * < 0(except -EOPNOTSUPP) on failure. > + * Return: > + * 0 - success, > + * -EOPNOTSUPP - hwpoison_filter() filtered the error event, > + * -EHWPOISON - the page was already poisoned, potentially > + * kill process, > + * other negative values - failure. > */ > int memory_failure(unsigned long pfn, int flags) > {