All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86: mm: use WARN_ONCE instead of printk and WARN_ON_ONCE
@ 2021-12-07 12:55 Qing Wang
  2021-12-07 14:10 ` Borislav Petkov
  0 siblings, 1 reply; 2+ messages in thread
From: Qing Wang @ 2021-12-07 12:55 UTC (permalink / raw)
  To: Dave Hansen, Andy Lutomirski, Peter Zijlstra, Thomas Gleixner,
	Ingo Molnar, Borislav Petkov, x86, H. Peter Anvin, linux-kernel
  Cc: Wang Qing

From: Wang Qing <wangqing@vivo.com>

Simply use WARN_ONCE instead of printk(KERN_WARNING, ...) and WARN_ON_ONCE.

Signed-off-by: Wang Qing <wangqing@vivo.com>
---
 arch/x86/mm/ioremap.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/arch/x86/mm/ioremap.c b/arch/x86/mm/ioremap.c
index 026031b..af9a321
--- a/arch/x86/mm/ioremap.c
+++ b/arch/x86/mm/ioremap.c
@@ -195,9 +195,8 @@ __ioremap_caller(resource_size_t phys_addr, unsigned long size,
 		return NULL;
 
 	if (!phys_addr_valid(phys_addr)) {
-		printk(KERN_WARNING "ioremap: invalid physical address %llx\n",
-		       (unsigned long long)phys_addr);
-		WARN_ON_ONCE(1);
+		WARN_ONCE(1, "ioremap: invalid physical address %llx\n",
+			 (unsigned long long)phys_addr);
 		return NULL;
 	}
 
-- 
2.7.4


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

* Re: [PATCH] x86: mm: use WARN_ONCE instead of printk and WARN_ON_ONCE
  2021-12-07 12:55 [PATCH] x86: mm: use WARN_ONCE instead of printk and WARN_ON_ONCE Qing Wang
@ 2021-12-07 14:10 ` Borislav Petkov
  0 siblings, 0 replies; 2+ messages in thread
From: Borislav Petkov @ 2021-12-07 14:10 UTC (permalink / raw)
  To: Qing Wang
  Cc: Dave Hansen, Andy Lutomirski, Peter Zijlstra, Thomas Gleixner,
	Ingo Molnar, x86, H. Peter Anvin, linux-kernel

On Tue, Dec 07, 2021 at 04:55:00AM -0800, Qing Wang wrote:
> From: Wang Qing <wangqing@vivo.com>
> 
> Simply use WARN_ONCE instead of printk(KERN_WARNING, ...) and WARN_ON_ONCE.
> 
> Signed-off-by: Wang Qing <wangqing@vivo.com>
> ---
>  arch/x86/mm/ioremap.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/x86/mm/ioremap.c b/arch/x86/mm/ioremap.c
> index 026031b..af9a321
> --- a/arch/x86/mm/ioremap.c
> +++ b/arch/x86/mm/ioremap.c
> @@ -195,9 +195,8 @@ __ioremap_caller(resource_size_t phys_addr, unsigned long size,
>  		return NULL;
>  
>  	if (!phys_addr_valid(phys_addr)) {
> -		printk(KERN_WARNING "ioremap: invalid physical address %llx\n",
> -		       (unsigned long long)phys_addr);
> -		WARN_ON_ONCE(1);
> +		WARN_ONCE(1, "ioremap: invalid physical address %llx\n",
> +			 (unsigned long long)phys_addr);
>  		return NULL;
>  	}
>  
> -- 

This is not an equivalent transformation.

-- 
Regards/Gruss,
    Boris.

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

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

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

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-07 12:55 [PATCH] x86: mm: use WARN_ONCE instead of printk and WARN_ON_ONCE Qing Wang
2021-12-07 14:10 ` Borislav Petkov

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.