All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next v2] x86/power: fix doc warnings in cpu.c
@ 2021-06-15  3:35 Baokun Li
  2021-06-17 12:12 ` Rafael J. Wysocki
  0 siblings, 1 reply; 4+ messages in thread
From: Baokun Li @ 2021-06-15  3:35 UTC (permalink / raw)
  To: rjw, pavel, tglx, mingo, bp, x86, hpa, linux-pm, linux-kernel
  Cc: weiyongjun1, yuehaibing, yangjihong1, yukuai3, libaokun1

Fixes the following W=1 kernel build warning(s):

 arch/x86/power/cpu.c:76: warning: Function parameter or
  member 'ctxt' not described in '__save_processor_state'
 arch/x86/power/cpu.c:192: warning: Function parameter or
  member 'ctxt' not described in '__restore_processor_state'

Signed-off-by: Baokun Li <libaokun1@huawei.com>
---
V1->V2:
	Fix the formatting of this kerneldoc comment

 arch/x86/power/cpu.c | 31 ++++++++++++++++---------------
 1 file changed, 16 insertions(+), 15 deletions(-)

diff --git a/arch/x86/power/cpu.c b/arch/x86/power/cpu.c
index 3a070e7cdb8b..54b530db5ed0 100644
--- a/arch/x86/power/cpu.c
+++ b/arch/x86/power/cpu.c
@@ -58,19 +58,20 @@ static void msr_restore_context(struct saved_context *ctxt)
 }
 
 /**
- *	__save_processor_state - save CPU registers before creating a
- *		hibernation image and before restoring the memory state from it
- *	@ctxt - structure to store the registers contents in
+ * __save_processor_statei() - Save CPU registers before creating a
+ *                             hibernation image and before restoring
+ *                             the memory state from it
+ * @ctxt: Structure to store the registers contents in.
  *
- *	NOTE: If there is a CPU register the modification of which by the
- *	boot kernel (ie. the kernel used for loading the hibernation image)
- *	might affect the operations of the restored target kernel (ie. the one
- *	saved in the hibernation image), then its contents must be saved by this
- *	function.  In other words, if kernel A is hibernated and different
- *	kernel B is used for loading the hibernation image into memory, the
- *	kernel A's __save_processor_state() function must save all registers
- *	needed by kernel A, so that it can operate correctly after the resume
- *	regardless of what kernel B does in the meantime.
+ * NOTE: If there is a CPU register the modification of which by the
+ * boot kernel (ie. the kernel used for loading the hibernation image)
+ * might affect the operations of the restored target kernel (ie. the one
+ * saved in the hibernation image), then its contents must be saved by this
+ * function.  In other words, if kernel A is hibernated and different
+ * kernel B is used for loading the hibernation image into memory, the
+ * kernel A's __save_processor_state() function must save all registers
+ * needed by kernel A, so that it can operate correctly after the resume
+ * regardless of what kernel B does in the meantime.
  */
 static void __save_processor_state(struct saved_context *ctxt)
 {
@@ -181,9 +182,9 @@ static void fix_processor_context(void)
 }
 
 /**
- * __restore_processor_state - restore the contents of CPU registers saved
- *                             by __save_processor_state()
- * @ctxt - structure to load the registers contents from
+ * __restore_processor_state() - Restore the contents of CPU registers saved
+ *                               by __save_processor_state()
+ * @ctxt: Structure to load the registers contents from.
  *
  * The asm code that gets us here will have restored a usable GDT, although
  * it will be pointing to the wrong alias.
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH -next v2] x86/power: fix doc warnings in cpu.c
  2021-06-15  3:35 [PATCH -next v2] x86/power: fix doc warnings in cpu.c Baokun Li
@ 2021-06-17 12:12 ` Rafael J. Wysocki
  2021-06-17 17:32   ` Rafael J. Wysocki
  0 siblings, 1 reply; 4+ messages in thread
From: Rafael J. Wysocki @ 2021-06-17 12:12 UTC (permalink / raw)
  To: Baokun Li
  Cc: Rafael J. Wysocki, Pavel Machek, Thomas Gleixner, Ingo Molnar,
	Borislav Petkov, the arch/x86 maintainers, H. Peter Anvin,
	Linux PM, Linux Kernel Mailing List, Wei Yongjun, Yue Haibing,
	yangjihong1, yu kuai

On Tue, Jun 15, 2021 at 5:26 AM Baokun Li <libaokun1@huawei.com> wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  arch/x86/power/cpu.c:76: warning: Function parameter or
>   member 'ctxt' not described in '__save_processor_state'
>  arch/x86/power/cpu.c:192: warning: Function parameter or
>   member 'ctxt' not described in '__restore_processor_state'
>
> Signed-off-by: Baokun Li <libaokun1@huawei.com>
> ---
> V1->V2:
>         Fix the formatting of this kerneldoc comment
>
>  arch/x86/power/cpu.c | 31 ++++++++++++++++---------------
>  1 file changed, 16 insertions(+), 15 deletions(-)
>
> diff --git a/arch/x86/power/cpu.c b/arch/x86/power/cpu.c
> index 3a070e7cdb8b..54b530db5ed0 100644
> --- a/arch/x86/power/cpu.c
> +++ b/arch/x86/power/cpu.c
> @@ -58,19 +58,20 @@ static void msr_restore_context(struct saved_context *ctxt)
>  }
>
>  /**
> - *     __save_processor_state - save CPU registers before creating a
> - *             hibernation image and before restoring the memory state from it
> - *     @ctxt - structure to store the registers contents in
> + * __save_processor_statei() - Save CPU registers before creating a
> + *                             hibernation image and before restoring
> + *                             the memory state from it
> + * @ctxt: Structure to store the registers contents in.
>   *
> - *     NOTE: If there is a CPU register the modification of which by the
> - *     boot kernel (ie. the kernel used for loading the hibernation image)
> - *     might affect the operations of the restored target kernel (ie. the one
> - *     saved in the hibernation image), then its contents must be saved by this
> - *     function.  In other words, if kernel A is hibernated and different
> - *     kernel B is used for loading the hibernation image into memory, the
> - *     kernel A's __save_processor_state() function must save all registers
> - *     needed by kernel A, so that it can operate correctly after the resume
> - *     regardless of what kernel B does in the meantime.
> + * NOTE: If there is a CPU register the modification of which by the
> + * boot kernel (ie. the kernel used for loading the hibernation image)
> + * might affect the operations of the restored target kernel (ie. the one
> + * saved in the hibernation image), then its contents must be saved by this
> + * function.  In other words, if kernel A is hibernated and different
> + * kernel B is used for loading the hibernation image into memory, the
> + * kernel A's __save_processor_state() function must save all registers
> + * needed by kernel A, so that it can operate correctly after the resume
> + * regardless of what kernel B does in the meantime.
>   */
>  static void __save_processor_state(struct saved_context *ctxt)
>  {
> @@ -181,9 +182,9 @@ static void fix_processor_context(void)
>  }
>
>  /**
> - * __restore_processor_state - restore the contents of CPU registers saved
> - *                             by __save_processor_state()
> - * @ctxt - structure to load the registers contents from
> + * __restore_processor_state() - Restore the contents of CPU registers saved
> + *                               by __save_processor_state()
> + * @ctxt: Structure to load the registers contents from.
>   *
>   * The asm code that gets us here will have restored a usable GDT, although
>   * it will be pointing to the wrong alias.
> --

Applied as 5.14 material, thanks!

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH -next v2] x86/power: fix doc warnings in cpu.c
  2021-06-17 12:12 ` Rafael J. Wysocki
@ 2021-06-17 17:32   ` Rafael J. Wysocki
  2021-06-18  1:25     ` libaokun (A)
  0 siblings, 1 reply; 4+ messages in thread
From: Rafael J. Wysocki @ 2021-06-17 17:32 UTC (permalink / raw)
  To: Baokun Li
  Cc: Rafael J. Wysocki, Pavel Machek, Thomas Gleixner, Ingo Molnar,
	Borislav Petkov, the arch/x86 maintainers, H. Peter Anvin,
	Linux PM, Linux Kernel Mailing List, Wei Yongjun, Yue Haibing,
	yangjihong1, yu kuai

On Thu, Jun 17, 2021 at 2:12 PM Rafael J. Wysocki <rafael@kernel.org> wrote:
>
> On Tue, Jun 15, 2021 at 5:26 AM Baokun Li <libaokun1@huawei.com> wrote:
> >
> > Fixes the following W=1 kernel build warning(s):
> >
> >  arch/x86/power/cpu.c:76: warning: Function parameter or
> >   member 'ctxt' not described in '__save_processor_state'
> >  arch/x86/power/cpu.c:192: warning: Function parameter or
> >   member 'ctxt' not described in '__restore_processor_state'
> >
> > Signed-off-by: Baokun Li <libaokun1@huawei.com>
> > ---
> > V1->V2:
> >         Fix the formatting of this kerneldoc comment
> >
> >  arch/x86/power/cpu.c | 31 ++++++++++++++++---------------
> >  1 file changed, 16 insertions(+), 15 deletions(-)
> >
> > diff --git a/arch/x86/power/cpu.c b/arch/x86/power/cpu.c
> > index 3a070e7cdb8b..54b530db5ed0 100644
> > --- a/arch/x86/power/cpu.c
> > +++ b/arch/x86/power/cpu.c
> > @@ -58,19 +58,20 @@ static void msr_restore_context(struct saved_context *ctxt)
> >  }
> >
> >  /**
> > - *     __save_processor_state - save CPU registers before creating a
> > - *             hibernation image and before restoring the memory state from it
> > - *     @ctxt - structure to store the registers contents in
> > + * __save_processor_statei() - Save CPU registers before creating a
> > + *                             hibernation image and before restoring
> > + *                             the memory state from it
> > + * @ctxt: Structure to store the registers contents in.
> >   *
> > - *     NOTE: If there is a CPU register the modification of which by the
> > - *     boot kernel (ie. the kernel used for loading the hibernation image)
> > - *     might affect the operations of the restored target kernel (ie. the one
> > - *     saved in the hibernation image), then its contents must be saved by this
> > - *     function.  In other words, if kernel A is hibernated and different
> > - *     kernel B is used for loading the hibernation image into memory, the
> > - *     kernel A's __save_processor_state() function must save all registers
> > - *     needed by kernel A, so that it can operate correctly after the resume
> > - *     regardless of what kernel B does in the meantime.
> > + * NOTE: If there is a CPU register the modification of which by the
> > + * boot kernel (ie. the kernel used for loading the hibernation image)
> > + * might affect the operations of the restored target kernel (ie. the one
> > + * saved in the hibernation image), then its contents must be saved by this
> > + * function.  In other words, if kernel A is hibernated and different
> > + * kernel B is used for loading the hibernation image into memory, the
> > + * kernel A's __save_processor_state() function must save all registers
> > + * needed by kernel A, so that it can operate correctly after the resume
> > + * regardless of what kernel B does in the meantime.
> >   */
> >  static void __save_processor_state(struct saved_context *ctxt)
> >  {
> > @@ -181,9 +182,9 @@ static void fix_processor_context(void)
> >  }
> >
> >  /**
> > - * __restore_processor_state - restore the contents of CPU registers saved
> > - *                             by __save_processor_state()
> > - * @ctxt - structure to load the registers contents from
> > + * __restore_processor_state() - Restore the contents of CPU registers saved
> > + *                               by __save_processor_state()
> > + * @ctxt: Structure to load the registers contents from.
> >   *
> >   * The asm code that gets us here will have restored a usable GDT, although
> >   * it will be pointing to the wrong alias.
> > --
>
> Applied as 5.14 material, thanks!

And dropped, because it introduced a build issue.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH -next v2] x86/power: fix doc warnings in cpu.c
  2021-06-17 17:32   ` Rafael J. Wysocki
@ 2021-06-18  1:25     ` libaokun (A)
  0 siblings, 0 replies; 4+ messages in thread
From: libaokun (A) @ 2021-06-18  1:25 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Rafael J. Wysocki, Pavel Machek, Thomas Gleixner, Ingo Molnar,
	Borislav Petkov, the arch/x86 maintainers, H. Peter Anvin,
	Linux PM, Linux Kernel Mailing List, Wei Yongjun, Yue Haibing,
	yangjihong1, yu kuai

Thank you for your advice.

I'm about to send a patch v3 with the changes to fix the warning.

Best Regards.


在 2021/6/18 1:32, Rafael J. Wysocki 写道:
> On Thu, Jun 17, 2021 at 2:12 PM Rafael J. Wysocki <rafael@kernel.org> wrote:
>> On Tue, Jun 15, 2021 at 5:26 AM Baokun Li <libaokun1@huawei.com> wrote:
>>> Fixes the following W=1 kernel build warning(s):
>>>
>>>   arch/x86/power/cpu.c:76: warning: Function parameter or
>>>    member 'ctxt' not described in '__save_processor_state'
>>>   arch/x86/power/cpu.c:192: warning: Function parameter or
>>>    member 'ctxt' not described in '__restore_processor_state'
>>>
>>> Signed-off-by: Baokun Li <libaokun1@huawei.com>
>>> ---
>>> V1->V2:
>>>          Fix the formatting of this kerneldoc comment
>>>
>>>   arch/x86/power/cpu.c | 31 ++++++++++++++++---------------
>>>   1 file changed, 16 insertions(+), 15 deletions(-)
>>>
>>> diff --git a/arch/x86/power/cpu.c b/arch/x86/power/cpu.c
>>> index 3a070e7cdb8b..54b530db5ed0 100644
>>> --- a/arch/x86/power/cpu.c
>>> +++ b/arch/x86/power/cpu.c
>>> @@ -58,19 +58,20 @@ static void msr_restore_context(struct saved_context *ctxt)
>>>   }
>>>
>>>   /**
>>> - *     __save_processor_state - save CPU registers before creating a
>>> - *             hibernation image and before restoring the memory state from it
>>> - *     @ctxt - structure to store the registers contents in
>>> + * __save_processor_statei() - Save CPU registers before creating a
>>> + *                             hibernation image and before restoring
>>> + *                             the memory state from it
>>> + * @ctxt: Structure to store the registers contents in.
>>>    *
>>> - *     NOTE: If there is a CPU register the modification of which by the
>>> - *     boot kernel (ie. the kernel used for loading the hibernation image)
>>> - *     might affect the operations of the restored target kernel (ie. the one
>>> - *     saved in the hibernation image), then its contents must be saved by this
>>> - *     function.  In other words, if kernel A is hibernated and different
>>> - *     kernel B is used for loading the hibernation image into memory, the
>>> - *     kernel A's __save_processor_state() function must save all registers
>>> - *     needed by kernel A, so that it can operate correctly after the resume
>>> - *     regardless of what kernel B does in the meantime.
>>> + * NOTE: If there is a CPU register the modification of which by the
>>> + * boot kernel (ie. the kernel used for loading the hibernation image)
>>> + * might affect the operations of the restored target kernel (ie. the one
>>> + * saved in the hibernation image), then its contents must be saved by this
>>> + * function.  In other words, if kernel A is hibernated and different
>>> + * kernel B is used for loading the hibernation image into memory, the
>>> + * kernel A's __save_processor_state() function must save all registers
>>> + * needed by kernel A, so that it can operate correctly after the resume
>>> + * regardless of what kernel B does in the meantime.
>>>    */
>>>   static void __save_processor_state(struct saved_context *ctxt)
>>>   {
>>> @@ -181,9 +182,9 @@ static void fix_processor_context(void)
>>>   }
>>>
>>>   /**
>>> - * __restore_processor_state - restore the contents of CPU registers saved
>>> - *                             by __save_processor_state()
>>> - * @ctxt - structure to load the registers contents from
>>> + * __restore_processor_state() - Restore the contents of CPU registers saved
>>> + *                               by __save_processor_state()
>>> + * @ctxt: Structure to load the registers contents from.
>>>    *
>>>    * The asm code that gets us here will have restored a usable GDT, although
>>>    * it will be pointing to the wrong alias.
>>> --
>> Applied as 5.14 material, thanks!
> And dropped, because it introduced a build issue.
> .

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-06-18  1:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-15  3:35 [PATCH -next v2] x86/power: fix doc warnings in cpu.c Baokun Li
2021-06-17 12:12 ` Rafael J. Wysocki
2021-06-17 17:32   ` Rafael J. Wysocki
2021-06-18  1:25     ` libaokun (A)

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.