linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next 1/2] x86: Use rdmsrl instead of rdmsr
@ 2021-12-10  3:22 Yang Li
  2021-12-10  3:22 ` [PATCH -next 2/2] x86: Fix kernel-doc Yang Li
  2021-12-28 21:07 ` [PATCH -next 1/2] x86: Use rdmsrl instead of rdmsr Borislav Petkov
  0 siblings, 2 replies; 3+ messages in thread
From: Yang Li @ 2021-12-10  3:22 UTC (permalink / raw)
  To: tglx; +Cc: mingo, bp, dave.hansen, x86, hpa, linux-kernel, Li Yang, Abaci Robot

From: Li Yang <yang.lee@linux.alibaba.com>

In the current scenario, variable 'hi' set but not used,
rdmsrl() does not change the function, but it is more concise.

Eliminate the following clang warnings:
arch/x86/kernel/process.c:889:10: warning: variable 'hi' set but not
used [-Wunused-but-set-variable]

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Li Yang <yang.lee@linux.alibaba.com>
---
 arch/x86/kernel/process.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c
index 5d481038fe0b..b415f30278d1 100644
--- a/arch/x86/kernel/process.c
+++ b/arch/x86/kernel/process.c
@@ -886,7 +886,7 @@ void amd_e400_c1e_apic_setup(void)
 
 void __init arch_post_acpi_subsys_init(void)
 {
-	u32 lo, hi;
+	u32 lo;
 
 	if (!boot_cpu_has_bug(X86_BUG_AMD_E400))
 		return;
@@ -896,7 +896,7 @@ void __init arch_post_acpi_subsys_init(void)
 	 * the machine is affected K8_INTP_C1E_ACTIVE_MASK bits are set in
 	 * MSR_K8_INT_PENDING_MSG.
 	 */
-	rdmsr(MSR_K8_INT_PENDING_MSG, lo, hi);
+	rdmsrl(MSR_K8_INT_PENDING_MSG, lo);
 	if (!(lo & K8_INTP_C1E_ACTIVE_MASK))
 		return;
 
-- 
2.34.0


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

* [PATCH -next 2/2] x86: Fix kernel-doc
  2021-12-10  3:22 [PATCH -next 1/2] x86: Use rdmsrl instead of rdmsr Yang Li
@ 2021-12-10  3:22 ` Yang Li
  2021-12-28 21:07 ` [PATCH -next 1/2] x86: Use rdmsrl instead of rdmsr Borislav Petkov
  1 sibling, 0 replies; 3+ messages in thread
From: Yang Li @ 2021-12-10  3:22 UTC (permalink / raw)
  To: tglx; +Cc: mingo, bp, dave.hansen, x86, hpa, linux-kernel, Li Yang, Abaci Robot

From: Li Yang <yang.lee@linux.alibaba.com>

Fix function name in process.c kernel-doc comment
to remove a warning found by running scripts/kernel-doc,
which is caused by using 'make W=1'.

arch/x86/kernel/process.c:411: warning: expecting prototype for
tss_update_io_bitmap(). Prototype was for native_tss_update_io_bitmap()
instead

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Li Yang <yang.lee@linux.alibaba.com>
---
 arch/x86/kernel/process.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c
index b415f30278d1..290c5bf610f1 100644
--- a/arch/x86/kernel/process.c
+++ b/arch/x86/kernel/process.c
@@ -405,7 +405,7 @@ static void tss_copy_io_bitmap(struct tss_struct *tss, struct io_bitmap *iobm)
 }
 
 /**
- * tss_update_io_bitmap - Update I/O bitmap before exiting to usermode
+ * native_tss_update_io_bitmap - Update I/O bitmap before exiting to usermode
  */
 void native_tss_update_io_bitmap(void)
 {
-- 
2.34.0


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

* Re: [PATCH -next 1/2] x86: Use rdmsrl instead of rdmsr
  2021-12-10  3:22 [PATCH -next 1/2] x86: Use rdmsrl instead of rdmsr Yang Li
  2021-12-10  3:22 ` [PATCH -next 2/2] x86: Fix kernel-doc Yang Li
@ 2021-12-28 21:07 ` Borislav Petkov
  1 sibling, 0 replies; 3+ messages in thread
From: Borislav Petkov @ 2021-12-28 21:07 UTC (permalink / raw)
  To: Yang Li; +Cc: tglx, mingo, dave.hansen, x86, hpa, linux-kernel, Abaci Robot

On Fri, Dec 10, 2021 at 11:22:07AM +0800, Yang Li wrote:
> From: Li Yang <yang.lee@linux.alibaba.com>
> 
> In the current scenario, variable 'hi' set but not used,
> rdmsrl() does not change the function, but it is more concise.
> 
> Eliminate the following clang warnings:
> arch/x86/kernel/process.c:889:10: warning: variable 'hi' set but not
> used [-Wunused-but-set-variable]
> 
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Signed-off-by: Li Yang <yang.lee@linux.alibaba.com>
> ---
>  arch/x86/kernel/process.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c
> index 5d481038fe0b..b415f30278d1 100644
> --- a/arch/x86/kernel/process.c
> +++ b/arch/x86/kernel/process.c
> @@ -886,7 +886,7 @@ void amd_e400_c1e_apic_setup(void)
>  
>  void __init arch_post_acpi_subsys_init(void)
>  {
> -	u32 lo, hi;
> +	u32 lo;
>  
>  	if (!boot_cpu_has_bug(X86_BUG_AMD_E400))
>  		return;
> @@ -896,7 +896,7 @@ void __init arch_post_acpi_subsys_init(void)
>  	 * the machine is affected K8_INTP_C1E_ACTIVE_MASK bits are set in
>  	 * MSR_K8_INT_PENDING_MSG.
>  	 */
> -	rdmsr(MSR_K8_INT_PENDING_MSG, lo, hi);
> +	rdmsrl(MSR_K8_INT_PENDING_MSG, lo);
>  	if (!(lo & K8_INTP_C1E_ACTIVE_MASK))
>  		return;
>  
> -- 

I believe you folks have been warned a bunch of times to think first
before acting upon a warning your silly bot catches.

Because your "fix" shows that you didn't even look at rdmsrl()'s
definition and what the second variable width is.

gcc explains it this way:

arch/x86/kernel/process.c: In function ‘arch_post_acpi_subsys_init’:
./arch/x86/include/asm/msr.h:277:11: warning: conversion from ‘long long unsigned int’ to ‘u32’ {aka ‘unsigned int’} may change value [-Wconversion]
  277 |  ((val) = native_read_msr((msr)))
      |           ^~~~~~~~~~~~~~~
arch/x86/kernel/process.c:899:2: note: in expansion of macro ‘rdmsrl’
  899 |  rdmsrl(MSR_K8_INT_PENDING_MSG, lo);
      |  ^~~~~~

so I'm ignoring all submissions from you from now on.

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

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

end of thread, other threads:[~2021-12-28 21:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-10  3:22 [PATCH -next 1/2] x86: Use rdmsrl instead of rdmsr Yang Li
2021-12-10  3:22 ` [PATCH -next 2/2] x86: Fix kernel-doc Yang Li
2021-12-28 21:07 ` [PATCH -next 1/2] x86: Use rdmsrl instead of rdmsr Borislav Petkov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).