Skip to content

Commit

Permalink
powerpc/powernv: Skip registering log region when CONFIG_PRINTK=n
Browse files Browse the repository at this point in the history
When CONFIG_PRINTK=n, log_buf_addr_get() returns NULL and log_buf_len_get()
return 0. Check for these return values and skip registering the dump buffer.

Signed-off-by: Pranith Kumar <[email protected]>
Reviewed-by: Stewart Smith <[email protected]>
Signed-off-by: Michael Ellerman <[email protected]>
  • Loading branch information
pranith authored and mpe committed Jan 27, 2015
1 parent 3df76a9 commit 6501ab5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions arch/powerpc/platforms/powernv/opal.c
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,13 @@ static void __init opal_dump_region_init(void)

/* Register kernel log buffer */
addr = log_buf_addr_get();
if (addr == NULL)
return;

size = log_buf_len_get();
if (size == 0)
return;

rc = opal_register_dump_region(OPAL_DUMP_REGION_LOG_BUF,
__pa(addr), size);
/* Don't warn if this is just an older OPAL that doesn't
Expand Down

0 comments on commit 6501ab5

Please sign in to comment.