Skip to contentSkip to conversation

printk: Add dummy routine for when CONFIG_PRINTK=n

PATCH In review Pranith Kumar 5 participants 9 messages Jan 22, 2015 – Jan 23, 2015

Subsystems (2)
lore
Share & tools
lore
#1 lore raw

PATCH v2 2/2 powerpc/powernv: Skip registering log region when CONFIG_PRINTK=n

In reply to Pranith Kumar

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.

CC Michael Ellerman <[email protected]>
---
 arch/powerpc/platforms/powernv/opal.c | 6 ++++++
 1 file changed, 6 insertions(+)
arch/powerpc/platforms/powernv/opal.c +6 -0
index f10b9ec..1db119f0 100644
@@ -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
Signature · 1 line
1.9.1
#0 lore raw

PATCH v2 1/2 printk: Add dummy routine for when CONFIG_PRINTK=n

There are missing dummy routines for log_buf_addr_get() and log_buf_len_get() for when CONFIG_PRINTK is not set causing build failures.

This patch adds these dummy routines at the appropriate location.

CC Michael Ellerman <[email protected]>
---
 include/linux/printk.h | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)
include/linux/printk.h +12 -3
index aeb9d7f..baa3f97 100644
@@ -10,9 +10,6 @@
 extern const char linux_banner[];
 extern const char linux_proc_banner[];
 
-extern char *log_buf_addr_get(void);
-extern u32 log_buf_len_get(void);
-
 static inline int printk_get_level(const char *buffer)
 {
 	if (buffer[0] == KERN_SOH_ASCII && buffer[1]) {
@@ -163,6 +160,8 @@ extern int kptr_restrict;
 
 extern void wake_up_klogd(void);
 
+char *log_buf_addr_get(void);
+u32 log_buf_len_get(void);
 void log_buf_kexec_setup(void);
 void __init setup_log_buf(int early);
 void dump_stack_set_arch_desc(const char *fmt, ...);
@@ -198,6 +197,16 @@ static inline void wake_up_klogd(void)
 {
 }
 
+static inline char *log_buf_addr_get(void)
+{
+	return NULL;
+}
+
+static inline u32 log_buf_len_get(void)
+{
+	return 0;
+}
+
 static inline void log_buf_kexec_setup(void)
 {
 }
Signature · 1 line
1.9.1
#2 lore raw

Re: [PATCH v2 2/2] powerpc/powernv: Skip registering log region when CONFIG_PRINTK=n

In reply to Pranith Kumar
Quoted 8 lines · Pranith Kumar

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.

CC Michael Ellerman <[email protected]>
---
 arch/powerpc/platforms/powernv/opal.c | 6 ++++++
 1 file changed, 6 insertions(+)

What changed since v1? I don't see anything?

cheers

Reviewed-by on v2 1/2
#7 lore raw
In reply to Pranith Kumar
Quoted 6 lines · Pranith Kumar

There are missing dummy routines for log_buf_addr_get() and log_buf_len_get() for when CONFIG_PRINTK is not set causing build failures.

This patch adds these dummy routines at the appropriate location.

Makes perfect sense and builds now :-)

Best Regards,
Petr

Quoted 53 lines
CC Michael Ellerman <[email protected]>
---
 include/linux/printk.h | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)
include/linux/printk.h +12 -3
index aeb9d7f..baa3f97 100644
@@ -10,9 +10,6 @@
 extern const char linux_banner[];
 extern const char linux_proc_banner[];
 
-extern char *log_buf_addr_get(void);
-extern u32 log_buf_len_get(void);
-
 static inline int printk_get_level(const char *buffer)
 {
 	if (buffer[0] == KERN_SOH_ASCII && buffer[1]) {
@@ -163,6 +160,8 @@ extern int kptr_restrict;
 
 extern void wake_up_klogd(void);
 
+char *log_buf_addr_get(void);
+u32 log_buf_len_get(void);
 void log_buf_kexec_setup(void);
 void __init setup_log_buf(int early);
 void dump_stack_set_arch_desc(const char *fmt, ...);
@@ -198,6 +197,16 @@ static inline void wake_up_klogd(void)
 {
 }
 
+static inline char *log_buf_addr_get(void)
+{
+	return NULL;
+}
+
+static inline u32 log_buf_len_get(void)
+{
+	return 0;
+}
+
 static inline void log_buf_kexec_setup(void)
 {
 }
Signature · 7 lines
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
reviewer Acked-by on v2 1/2
#8 lore raw
In reply to Pranith Kumar
Quoted 7 lines · On Wed, 21 Jan 2015 21:26:08 -0500 Pranith Kumar <[email protected]> wrote:

There are missing dummy routines for log_buf_addr_get() and log_buf_len_get() for when CONFIG_PRINTK is not set causing build failures.

This patch adds these dummy routines at the appropriate location.

CC Michael Ellerman <[email protected]>

-- Steve

#3 lore raw

Re: [PATCH v2 2/2] powerpc/powernv: Skip registering log region when CONFIG_PRINTK=n

In reply to Michael Ellerman
Quoted 4 lines · Michael Ellerman
Quoted 3 lines · Pranith Kumar

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.

Quoted 8 lines
Quoted 5 lines
CC Michael Ellerman <[email protected]>
---
 arch/powerpc/platforms/powernv/opal.c | 6 ++++++
 1 file changed, 6 insertions(+)

What changed since v1? I don't see anything?

Nothing in this patch but there is a v2 of the first patch in this series, so had to resend this patch with a v2.

Thanks!

Signature · 1 line
Pranith
#4 lore raw

Re: [PATCH v2 2/2] powerpc/powernv: Skip registering log region when CONFIG_PRINTK=n

Quoted 11 lines · Pranith Kumar
Quoted 10 lines · Michael Ellerman
Quoted 8 lines · Pranith Kumar

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.

CC Michael Ellerman <[email protected]>
---
 arch/powerpc/platforms/powernv/opal.c | 6 ++++++
 1 file changed, 6 insertions(+)
Quoted 5 lines
Quoted 2 lines

What changed since v1? I don't see anything?

Nothing in this patch but there is a v2 of the first patch in this series, so had to resend this patch with a v2.

You also missed my Reviewed-by :)

author Reviewed-by Stewart Smith
#5 lore raw

Re: [PATCH v2 2/2] powerpc/powernv: Skip registering log region when CONFIG_PRINTK=n

Quoted 12 lines · Stewart Smith
Quoted 11 lines · Pranith Kumar
Quoted 10 lines · Michael Ellerman
Quoted 8 lines · Pranith Kumar

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.

CC Michael Ellerman <[email protected]>
---
 arch/powerpc/platforms/powernv/opal.c | 6 ++++++
 1 file changed, 6 insertions(+)
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

What changed since v1? I don't see anything?

Nothing in this patch but there is a v2 of the first patch in this series, so had to resend this patch with a v2.

You also missed my Reviewed-by :)

Sincere apologies for the oversight. Maintainers, could you please add this Reviewed-by tag when picking this up?

Thanks!

Signature · 1 line
Pranith
#6 lore raw

Re: [PATCH v2 2/2] powerpc/powernv: Skip registering log region when CONFIG_PRINTK=n

Quoted 14 lines · Pranith Kumar
Quoted 12 lines · Stewart Smith
Quoted 11 lines · Pranith Kumar
Quoted 10 lines · Michael Ellerman
Quoted 8 lines · Pranith Kumar

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.

CC Michael Ellerman <[email protected]>
---
 arch/powerpc/platforms/powernv/opal.c | 6 ++++++
 1 file changed, 6 insertions(+)
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 1 line

What changed since v1? I don't see anything?

Nothing in this patch but there is a v2 of the first patch in this series, so had to resend this patch with a v2.

OK. You didn't send patch 1 to the this list though, so I only saw it on lkml. Please don't do that in future.

Quoted 6 lines
Quoted 1 line

You also missed my Reviewed-by :)

Sincere apologies for the oversight. Maintainers, could you please add this Reviewed-by tag when picking this up?

For future reference patchwork will catch these tags automatically. So if you have forgotten to add them you can always reply to your own patch like you have here and patchwork will detect them.

eg:

http://patchwork.ozlabs.org/patch/431648/mbox/

cheers