All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pranith Kumar <bobby.prani@gmail.com>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Paul Mackerras <paulus@samba.org>,
	Michael Ellerman <mpe@ellerman.id.au>,
	Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>,
	Anton Blanchard <anton@samba.org>,
	Neelesh Gupta <neelegup@linux.vnet.ibm.com>,
	Joel Stanley <joel@jms.id.au>,
	Vasant Hegde <hegdevasant@linux.vnet.ibm.com>,
	Rob Herring <robh@kernel.org>,
	linuxppc-dev@lists.ozlabs.org (open list:LINUX FOR POWERPC...),
	linux-kernel@vger.kernel.org (open list)
Subject: [PATCH v2 2/2] powerpc/powernv: Skip registering log region when CONFIG_PRINTK=n
Date: Wed, 21 Jan 2015 21:26:09 -0500	[thread overview]
Message-ID: <1421893570-6920-2-git-send-email-bobby.prani@gmail.com> (raw)
In-Reply-To: <1421893570-6920-1-git-send-email-bobby.prani@gmail.com>

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 <bobby.prani@gmail.com>
CC: Michael Ellerman <mpe@ellerman.id.au>
---
 arch/powerpc/platforms/powernv/opal.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/arch/powerpc/platforms/powernv/opal.c b/arch/powerpc/platforms/powernv/opal.c
index f10b9ec..1db119f0 100644
--- a/arch/powerpc/platforms/powernv/opal.c
+++ b/arch/powerpc/platforms/powernv/opal.c
@@ -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
-- 
1.9.1


  reply	other threads:[~2015-01-22  2:26 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-22  2:26 [PATCH v2 1/2] printk: Add dummy routine for when CONFIG_PRINTK=n Pranith Kumar
2015-01-22  2:26 ` Pranith Kumar [this message]
2015-01-22  5:19   ` [PATCH v2 2/2] powerpc/powernv: Skip registering log region " Michael Ellerman
2015-01-22  5:19     ` Michael Ellerman
2015-01-22 14:34     ` Pranith Kumar
2015-01-22 14:34       ` Pranith Kumar
2015-01-22 22:35       ` Stewart Smith
2015-01-22 22:35         ` Stewart Smith
2015-01-23  4:03         ` Pranith Kumar
2015-01-23  4:03           ` Pranith Kumar
2015-01-23  4:13           ` Michael Ellerman
2015-01-23  4:13             ` Michael Ellerman
2015-01-22 14:13 ` [PATCH v2 1/2] printk: Add dummy routine for " Petr Mladek
2015-01-22 14:17 ` Steven Rostedt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1421893570-6920-2-git-send-email-bobby.prani@gmail.com \
    --to=bobby.prani@gmail.com \
    --cc=anton@samba.org \
    --cc=benh@kernel.crashing.org \
    --cc=hegdevasant@linux.vnet.ibm.com \
    --cc=joel@jms.id.au \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mahesh@linux.vnet.ibm.com \
    --cc=mpe@ellerman.id.au \
    --cc=neelegup@linux.vnet.ibm.com \
    --cc=paulus@samba.org \
    --cc=robh@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.