public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: zhong jiang <zhongjiang@huawei.com>
To: Joe Perches <joe@perches.com>
Cc: Borislav Petkov <bp@alien8.de>, <peterz@infradead.org>,
	<tglx@linutronix.de>, <mingo@redhat.com>,
	<dave.hansen@linux.intel.com>, <hpa@zytor.com>, <x86@kernel.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] mm/ioremap: Use WARN_ONCE instead of printk() + WARN_ON_ONCE()
Date: Fri, 1 Nov 2019 23:18:32 +0800	[thread overview]
Message-ID: <5DBC4CC8.2080003@huawei.com> (raw)
In-Reply-To: <be4803c67e2e1f9e91e59bfd7b23f938619f66e8.camel@perches.com>

On 2019/10/31 20:00, Joe Perches wrote:
> On Thu, 2019-10-31 at 19:36 +0800, zhong jiang wrote:
>> On 2019/10/31 19:03, Borislav Petkov wrote:
>>> On Wed, Oct 30, 2019 at 04:57:18PM +0800, zhong jiang wrote:
>>>> WARN_ONCE is more clear and simpler. Just replace it.
> []
>>>> diff --git a/arch/x86/mm/ioremap.c b/arch/x86/mm/ioremap.c
> []
>>>> @@ -172,9 +172,8 @@ static void __ioremap_check_mem(resource_size_t 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);
>>> Does
>>> 	WARN_ONCE(!phys_addr_valid(phys_addr),
>>> 		  "ioremap: invalid physical address %llx\n",
>>> 		  (unsigned long long)phys_addr);
>>>
>>> work too?
>>>
>> Thanks, That is better. Will repost.
> Perhaps this is not good patch concept as now each
> invalid physical address will not be emitted.
>
> Before:
> 	each invalid physical address printed
> 	one stack dump
>
> After:
> 	one stck dump with first invalid physical address.
>
I misunderstand your meaning.  You're right.  My patch change its logical.
Thanks for your reminder.

Sincerely,
zhong jiang
>
> .
>



  parent reply	other threads:[~2019-11-01 15:18 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-30  8:57 [PATCH] mm/ioremap: Use WARN_ONCE instead of printk() + WARN_ON_ONCE() zhong jiang
2019-10-31 11:03 ` Borislav Petkov
2019-10-31 11:36   ` zhong jiang
2019-10-31 12:00     ` Joe Perches
2019-10-31 12:40       ` zhong jiang
2019-11-01 15:18       ` zhong jiang [this message]
2019-10-31 11:54   ` zhong jiang
2019-10-31 15:49     ` Borislav Petkov
2019-10-31 15:54       ` zhong jiang
2019-11-01  8:45         ` Borislav Petkov
2019-11-01 15:32           ` zhong jiang
2019-11-01 16:03             ` Borislav Petkov

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=5DBC4CC8.2080003@huawei.com \
    --to=zhongjiang@huawei.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /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