[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <0038691f-b247-f3b2-ee25-ac7b0e7b9aeb@kernel.org>
Date: Mon, 26 Jul 2021 13:20:23 -0700
From: Andy Lutomirski <luto@...nel.org>
To: Jason Wang <wangborong@...rlc.com>
Cc: dave.hansen@...ux.intel.com, peterz@...radead.org,
tglx@...utronix.de, mingo@...hat.com, bp@...en8.de, x86@...nel.org,
hpa@...or.com, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] x86/mm: use WARN_ONCE
On 7/26/21 6:08 AM, Jason Wang wrote:
> printk + WARN_ON_ONCE can be just WARN_ONCE.
>
> Signed-off-by: Jason Wang <wangborong@...rlc.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 60ade7dd71bd..3e57035ef9e3 100644
> --- 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 isn't a no-op change. Before, it would KERN_WARNING once per event
and dump a trace once. Now it will only print anything at all once.
Powered by blists - more mailing lists