From: Shivank Garg <shivankg@amd.com>
To: Ingo Molnar <mingo@kernel.org>
Cc: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de,
dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com,
luto@kernel.org, peterz@infradead.org, rafael@kernel.org,
pavel@kernel.org, akpm@linux-foundation.org,
linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org,
sohil.mehta@intel.com, rui.zhang@intel.com,
yuntao.wang@linux.dev, kai.huang@intel.com, xiaoyao.li@intel.com,
peterx@redhat.com, sandipan.das@amd.com, ak@linux.intel.com,
rostedt@goodmis.org
Subject: Re: [PATCH RESEND 1/4] x86/mm: pgtable: Fix W=1 build kernel-doc warnings
Date: Thu, 15 May 2025 15:27:41 +0530 [thread overview]
Message-ID: <eddc986d-62be-425c-8065-3cd5a3922026@amd.com> (raw)
In-Reply-To: <aCWPp4wYwauSuTed@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2457 bytes --]
On 5/15/2025 12:24 PM, Ingo Molnar wrote:
>
> * Shivank Garg <shivankg@amd.com> wrote:
>
>>
>>
>> On 5/14/2025 2:50 PM, Ingo Molnar wrote:
>>>
>>> * Shivank Garg <shivankg@amd.com> wrote:
>>>
>>>>>> @@ -665,6 +665,9 @@ void native_set_fixmap(unsigned /* enum fixed_addresses */ idx,
>>>>>> #ifdef CONFIG_X86_5LEVEL
>>>>>> /**
>>>>>> * p4d_set_huge - setup kernel P4D mapping
>>>>>> + * @p4d: Pointer to a p4d entry.
>>>>>> + * @addr: Virtual Address associated with p4d.
>>>>>> + * @prot: Protection bits to use.
>>>>>
>>>>> How about using the same capitalization you already see in this
>>>>> description?
>>>
>>>> Please review the revised patch with suggested changes.
>>>
>>> I think you misunderstood: why are you using 'p4d', while a line before
>>> it's 'P4D'? It's an acronym, and only used lowercase when it's a local
>>> variable. 'p4d is a pointer to a p4d entry' is doubly confusing in that
>>> regard ...
>>>
>>> Same for PMD/PUD etc.
>>>
>>
>> Thank you for the clarification. I understand it now.
>> I hope the attached patch looks good now.
>
> No. Please re-read your patches and see whether you caught everything,
> not just the things I pointed out ...
>
>> /**
>> * reserve_top_address - reserves a hole in the top of kernel address space
>> - * @reserve - size of hole to reserve
>> + * @reserve: size of hole to reserve.
>
> And here the original capitalization in your -v1 patch was better.
>
>> * p4d_set_huge - setup kernel P4D mapping
>> + * @p4d: pointer to a P4D entry.
>> + * @addr: virtual Address associated with p4d.
>> + * @prot: protection bits to use.
>
> Why is 'address' capitalized here?
>
>> /**
>> * pud_set_huge - setup kernel PUD mapping
>> + * @pud: pointer to a PUD entry.
>> + * @addr: virtual Address associated with pud.
>> + * @prot: protection bits to use.
>
> s/pud
> /the PUD entry
>
> Also, similar errors are elsewhere as well.
I'm sorry for missing these details in the previous revision.
I'm changing the first letter of variable description to capital.
https://docs.kernel.org/doc-guide/kernel-doc.html
/**
* function_name() - Brief description of function.
* @arg1: Describe the first argument.
* @arg2: Describe the second argument.
* One can provide multiple line descriptions
* for arguments.
Function description also starts with capital letter in the doc-guide
and other kernel places so this should make it consistent.
Thanks,
Shivank
[-- Attachment #2: 0001-x86-mm-pgtable-Fix-W-1-build-kernel-doc-warnings.patch --]
[-- Type: text/plain, Size: 3745 bytes --]
From c76dd45d2cc8221412d69cede4fd713ce775ee64 Mon Sep 17 00:00:00 2001
From: Shivank Garg <shivankg@amd.com>
Date: Wed, 30 Apr 2025 11:29:59 +0000
Subject: [PATCH] x86/mm: pgtable: Fix W=1 build kernel-doc warnings
Sample warnings generated with 'make W=1':
arch/x86/mm/pgtable.c:623: warning: Function parameter or struct member 'reserve' not described in 'reserve_top_address'
arch/x86/mm/pgtable.c:672: warning: Function parameter or struct member 'p4d' not described in 'p4d_set_huge'
arch/x86/mm/pgtable.c:672: warning: Function parameter or struct member 'addr' not described in 'p4d_set_huge'
... so on
Add missing parameter documentation in page table functions to
fix kernel-doc warnings.
Signed-off-by: Shivank Garg <shivankg@amd.com>
---
arch/x86/mm/pgtable.c | 30 +++++++++++++++++++++---------
1 file changed, 21 insertions(+), 9 deletions(-)
diff --git a/arch/x86/mm/pgtable.c b/arch/x86/mm/pgtable.c
index f7ae44d3dd9e..dc55e4d4c226 100644
--- a/arch/x86/mm/pgtable.c
+++ b/arch/x86/mm/pgtable.c
@@ -613,8 +613,8 @@ pud_t pudp_invalidate(struct vm_area_struct *vma, unsigned long address,
#endif
/**
- * reserve_top_address - reserves a hole in the top of kernel address space
- * @reserve - size of hole to reserve
+ * reserve_top_address - Reserves a hole in the top of kernel address space
+ * @reserve: Size of hole to reserve.
*
* Can be used to relocate the fixmap area and poke a hole in the top
* of kernel address space to make room for a hypervisor.
@@ -664,7 +664,10 @@ void native_set_fixmap(unsigned /* enum fixed_addresses */ idx,
#ifdef CONFIG_HAVE_ARCH_HUGE_VMAP
#ifdef CONFIG_X86_5LEVEL
/**
- * p4d_set_huge - setup kernel P4D mapping
+ * p4d_set_huge - Setup kernel P4D mapping
+ * @p4d: Pointer to the P4D entry.
+ * @addr: Virtual address associated with the P4D entry.
+ * @prot: Protection bits to use.
*
* No 512GB pages yet -- always return 0
*/
@@ -674,9 +677,10 @@ int p4d_set_huge(p4d_t *p4d, phys_addr_t addr, pgprot_t prot)
}
/**
- * p4d_clear_huge - clear kernel P4D mapping when it is set
+ * p4d_clear_huge - Clear kernel P4D mapping when it is set
+ * @p4d: Pointer to the P4D entry to clear.
*
- * No 512GB pages yet -- always return 0
+ * No 512GB pages yet -- do nothing
*/
void p4d_clear_huge(p4d_t *p4d)
{
@@ -684,7 +688,10 @@ void p4d_clear_huge(p4d_t *p4d)
#endif
/**
- * pud_set_huge - setup kernel PUD mapping
+ * pud_set_huge - Setup kernel PUD mapping
+ * @pud: Pointer to the PUD entry.
+ * @addr: Virtual address associated with the PUD entry.
+ * @prot: Protection bits to use.
*
* MTRRs can override PAT memory types with 4KiB granularity. Therefore, this
* function sets up a huge page only if the complete range has the same MTRR
@@ -715,7 +722,10 @@ int pud_set_huge(pud_t *pud, phys_addr_t addr, pgprot_t prot)
}
/**
- * pmd_set_huge - setup kernel PMD mapping
+ * pmd_set_huge - Setup kernel PMD mapping
+ * @pmd: Pointer to the PMD entry.
+ * @addr: Virtual address associated with the PMD entry.
+ * @prot: Protection bits to use.
*
* See text over pud_set_huge() above.
*
@@ -744,7 +754,8 @@ int pmd_set_huge(pmd_t *pmd, phys_addr_t addr, pgprot_t prot)
}
/**
- * pud_clear_huge - clear kernel PUD mapping when it is set
+ * pud_clear_huge - Clear kernel PUD mapping when it is set
+ * @pud: Pointer to the PUD entry to clear.
*
* Returns 1 on success and 0 on failure (no PUD map is found).
*/
@@ -759,7 +770,8 @@ int pud_clear_huge(pud_t *pud)
}
/**
- * pmd_clear_huge - clear kernel PMD mapping when it is set
+ * pmd_clear_huge - Clear kernel PMD mapping when it is set
+ * @pmd: Pointer to the PMD entry to clear.
*
* Returns 1 on success and 0 on failure (no PMD map is found).
*/
--
2.34.1
next prev parent reply other threads:[~2025-05-15 9:57 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-14 6:26 Shivank Garg
2025-05-14 6:26 ` [PATCH RESEND 2/4] x86/power: hibernate: " Shivank Garg
2025-05-14 8:07 ` [tip: x86/cleanups] " tip-bot2 for Shivank Garg
2025-05-14 6:26 ` [PATCH RESEND 3/4] x86/mm/pat: Fix W=1 build kernel-doc warning Shivank Garg
2025-05-14 8:07 ` [tip: x86/cleanups] " tip-bot2 for Shivank Garg
2025-05-14 6:26 ` [PATCH RESEND 4/4] x86/apic: " Shivank Garg
2025-05-14 7:56 ` Ingo Molnar
2025-05-15 6:33 ` Shivank Garg
2025-05-15 6:38 ` Ingo Molnar
2025-05-15 6:49 ` Ingo Molnar
2025-05-15 7:19 ` Thomas Gleixner
2025-05-15 8:15 ` [PATCH] x86/apic: Better document spurious_interrupt() and __spurious_interrupt() Ingo Molnar
2025-05-14 7:54 ` [PATCH RESEND 1/4] x86/mm: pgtable: Fix W=1 build kernel-doc warnings Ingo Molnar
2025-05-14 8:06 ` Shivank Garg
2025-05-14 8:27 ` Shivank Garg
2025-05-14 9:20 ` Ingo Molnar
2025-05-15 3:54 ` Shivank Garg
2025-05-15 6:54 ` Ingo Molnar
2025-05-15 9:57 ` Shivank Garg [this message]
2025-05-15 15:06 ` Ingo Molnar
2025-05-15 18:10 ` Shivank Garg
2025-05-15 15:11 ` [tip: x86/core] x86/mm: Fix kernel-doc descriptions of various pgtable methods tip-bot2 for Shivank Garg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=eddc986d-62be-425c-8065-3cd5a3922026@amd.com \
--to=shivankg@amd.com \
--cc=ak@linux.intel.com \
--cc=akpm@linux-foundation.org \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=kai.huang@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=luto@kernel.org \
--cc=mingo@kernel.org \
--cc=mingo@redhat.com \
--cc=pavel@kernel.org \
--cc=peterx@redhat.com \
--cc=peterz@infradead.org \
--cc=rafael@kernel.org \
--cc=rostedt@goodmis.org \
--cc=rui.zhang@intel.com \
--cc=sandipan.das@amd.com \
--cc=sohil.mehta@intel.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
--cc=xiaoyao.li@intel.com \
--cc=yuntao.wang@linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®