Re: [PATCH V11 2/5] vsprintf: refactor %pK code out of pointer()

From: Steven Rostedt
Date: Tue Nov 28 2017 - 21:40:09 EST


On Wed, 29 Nov 2017 13:05:02 +1100
"Tobin C. Harding" <me@xxxxxxxx> wrote:

> + /*
> + * kptr_restrict==1 cannot be used in IRQ context
> + * because its test for CAP_SYSLOG would be meaningless.
> + */
> + if (in_irq() || in_serving_softirq() || in_nmi())

This could be replaced with:

if (!in_task())

Which is actually more efficient.

-- Steve

> + return string(buf, end, "pK-error", spec);