[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACT4Y+bjdmgdeRLM5kBaf6-vunFwFRD0_zCZX=A-rY+XEEfnEA@mail.gmail.com>
Date: Thu, 21 Jun 2018 09:59:05 +0200
From: Dmitry Vyukov <dvyukov@...gle.com>
To: Andy Shevchenko <andy.shevchenko@...il.com>
Cc: Dmitry Vyukov <dvyukov@...il.com>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>,
"maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" <x86@...nel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Sergey Senozhatsky <sergey.senozhatsky.work@...il.com>
Subject: Re: [PATCH] arch/x86: get rid of KERN_CONT in show_fault_oops()
On Thu, Jun 21, 2018 at 3:06 AM, Andy Shevchenko
<andy.shevchenko@...il.com> wrote:
> On Wed, Jun 20, 2018 at 3:55 PM, Dmitry Vyukov <dvyukov@...il.com> wrote:
>> From: Dmitry Vyukov <dvyukov@...gle.com>
>>
>> KERN_CONT leads to split lines in kernel output
>> and complicates useful changes to printk like
>> printing context before each line.
>>
>> Only acceptable use of continuations is basically
>> boot-time testing.
>>
>> Get rid of it.
>
>> + printk(KERN_ALERT "BUG: unable to handle kernel %s at %px\n",
>> + (address < PAGE_SIZE ? "NULL pointer dereference" :
>> + "paging request"), (void *) address);
>
> Perhaps pr_alert() ?
It's the same, right? Make sense.
> Btw, parens are redundant for the first argument.
>
> P.S. And personally I would rather do
> if (address < PAGE_SIZE)
> pr_alert(...NULL pointer dereference...);
> else
> pr_alert(...paging request...);
It's kinda shorter this way. Any other opinions?
pr_alert("BUG: unable to handle kernel %s at %px\n",
address < PAGE_SIZE ? "NULL pointer dereference" :
"paging request", (void *) address);
vs:
if (address < PAGE_SIZE)
pr_alert("BUG: unable to handle kernel NULL pointer
dereference at %px\n",
(void *) address);
else
pr_alert("BUG: unable to handle kernel paging request at %px\n",
(void *) address);
Or, should we just do:
pr_alert("BUG: unable to handle kernel paging request at %px\n",
(void *) address);
and not try to be too smart here? In the end, that can be a NULL deref
with 5K offset, right?
Powered by blists - more mailing lists