Re: [PATCH v3] lib/test_printf.c: accept "ptrval" as valid result for plain 'p' tests

From: Petr Mladek
Date: Fri Jun 15 2018 - 09:23:04 EST


On Wed 2018-06-13 19:18:40, Thierry Escande wrote:
> If the test_printf module is loaded before the crng is initialized, the
> plain 'p' tests will fail because the printed address will not be hashed
> and the buffer will contain "(____ptrval____)" or "(ptrval)" instead
> (64-bit vs 32-bit).
> Since we cannot wait for the crng to be initialized for an undefined
> time, both plain 'p' tests now accept the strings "(____ptrval____)" or
> "(ptrval)" as a valid result and print a warning message.
>
> Signed-off-by: Thierry Escande <thierry.escande@xxxxxxxxxx>

Revieved-by: Petr Mladek <pmladek@xxxxxxxx>

I have pushed this into printk.git, branch for-4.19

Best Regards,
Petr

PS: The split into plain_hash() and plain_format() is weird and even
confusing. They both just checks different halfs of the same output.

It would make sense to merge them. It would also remove the duplicated
code and warning. Anyone interested into sending a followup patch? ;-)