lkml.org 
[lkml]   [2019]   [Oct]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] mm/ioremap: Use WARN_ONCE instead of printk() + WARN_ON_ONCE()
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.
>
Yes, I has told that.

How you think my above patch in the mail. Thanks
>
> .
>


\
 
 \ /
  Last update: 2019-10-31 13:42    [W:0.078 / U:22.936 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site