[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <717cb54f7ac6dd1f94a5c57c10a8cb377eb199bd.camel@intel.com>
Date: Mon, 3 Nov 2025 23:47:11 +0000
From: "Huang, Kai" <kai.huang@...el.com>
To: "jarkko@...nel.org" <jarkko@...nel.org>, "x86@...nel.org"
<x86@...nel.org>, "bp@...en8.de" <bp@...en8.de>, "thorsten.blum@...ux.dev"
<thorsten.blum@...ux.dev>, "hpa@...or.com" <hpa@...or.com>,
"mingo@...hat.com" <mingo@...hat.com>, "tglx@...utronix.de"
<tglx@...utronix.de>, "dave.hansen@...ux.intel.com"
<dave.hansen@...ux.intel.com>
CC: "linux-sgx@...r.kernel.org" <linux-sgx@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] x86/sgx: Fix typos and formatting in function comments
On Mon, 2025-11-03 at 10:01 +0100, Thorsten Blum wrote:
> Fix typos and formatting in function comments to clarify that
> sgx_set_attribute() returns 0, not -0, to avoid confusion and to be
> consistent.
>
> Signed-off-by: Thorsten Blum <thorsten.blum@...ux.dev>
> ---
> arch/x86/kernel/cpu/sgx/main.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/arch/x86/kernel/cpu/sgx/main.c b/arch/x86/kernel/cpu/sgx/main.c
> index 2de01b379aa3..c33e2b56a3fc 100644
> --- a/arch/x86/kernel/cpu/sgx/main.c
> +++ b/arch/x86/kernel/cpu/sgx/main.c
> @@ -465,11 +465,11 @@ static struct sgx_epc_page *__sgx_alloc_epc_page_from_node(int nid)
> /**
> * __sgx_alloc_epc_page() - Allocate an EPC page
> *
> - * Iterate through NUMA nodes and reserve ia free EPC page to the caller. Start
> + * Iterate through NUMA nodes and reserve a free EPC page to the caller. Start
> * from the NUMA node, where the caller is executing.
> *
> * Return:
> - * - an EPC page: A borrowed EPC pages were available.
> + * - an EPC page: A borrowed EPC page if available.
> * - NULL: Out of EPC pages.
> */
Ack for fixing the typos.
> struct sgx_epc_page *__sgx_alloc_epc_page(void)
> @@ -898,8 +898,8 @@ static struct miscdevice sgx_dev_provision = {
> * /dev/sgx_provision is supported.
> *
> * Return:
> - * -0: SGX_ATTR_PROVISIONKEY is appended to allowed_attributes
> - * -EINVAL: Invalid, or not supported file descriptor
> + * - 0: SGX_ATTR_PROVISIONKEY is appended to allowed_attributes
> + * - -EINVAL: Invalid, or not supported file descriptor
> */
> int sgx_set_attribute(unsigned long *allowed_attributes,
> unsigned int attribute_fd)
It seems we don't have a consistent way of describing return values in the
k-doc comments in sgx/main.c. E.g.,
/**
* sgx_unmark_page_reclaimable() - Remove a page from the reclaim list
...
* Return:
* 0 on success,
* -EBUSY if the page is in the process of being reclaimed
*/
/**
* sgx_alloc_epc_page() - Allocate an EPC page
...
* Return:
* an EPC page,
* -errno on error
*/
Perhaps we should make them consistent in format.
But I think this can be done separately from fixing the typos. Maybe you
can split out the typo fixing as a separate patch, and have another patch to
fixing the return value description?
Powered by blists - more mailing lists