Re: [rcu:rcu/next 97/97] arch/blackfin/kernel/module.c:20:25: error: expected ')' before 'fmt'

2017-05-30 Thread Paul E. McKenney
On Tue, May 30, 2017 at 06:41:48PM -0700, Joe Perches wrote:
> Hey Paul.
> 
> Can you please fix the mod_debug macro definition
> as described below?
> 
> Thanks.  Joe

Like this?  (Applied and pushed in any case.)

And hey, I missed it as well...

Thanx, Paul



commit 4f98aa416ea0b085a7582e9cd801e6c0e7325a71
Author: Paul E. McKenney 
Date:   Tue May 30 15:20:37 2017 -0700

module: Fix pr_fmt() bug for header use of printk

This commit removes the pr_fmt() macro, replacing it with mod_err() and
mod_debug() macros to avoid errors when using printk() from header files.

Signed-off-by: Joe Perches 
Signed-off-by: Paul E. McKenney 

diff --git a/arch/blackfin/kernel/module.c b/arch/blackfin/kernel/module.c
index 0188c933b155..15af5768c403 100644
--- a/arch/blackfin/kernel/module.c
+++ b/arch/blackfin/kernel/module.c
@@ -4,8 +4,6 @@
  * Licensed under the GPL-2 or later
  */
 
-#define pr_fmt(fmt) "module %s: " fmt, mod->name
-
 #include 
 #include 
 #include 
@@ -16,6 +14,11 @@
 #include 
 #include 
 
+#define mod_err(mod, fmt, ...) \
+   pr_err("module %s: " fmt, (mod)->name, ##__VA_ARGS__)
+#define mod_debug(mod, fmt, ...)   \
+   pr_debug("module %s: " fmt, (mod)->name, ##__VA_ARGS__)
+
 /* Transfer the section to the L1 memory */
 int
 module_frob_arch_sections(Elf_Ehdr *hdr, Elf_Shdr *sechdrs,
@@ -44,7 +47,7 @@ module_frob_arch_sections(Elf_Ehdr *hdr, Elf_Shdr *sechdrs,
dest = l1_inst_sram_alloc(s->sh_size);
mod->arch.text_l1 = dest;
if (dest == NULL) {
-   pr_err("L1 inst memory allocation failed\n");
+   mod_err(mod, "L1 inst memory allocation 
failed\n");
return -1;
}
dma_memcpy(dest, (void *)s->sh_addr, s->sh_size);
@@ -56,7 +59,7 @@ module_frob_arch_sections(Elf_Ehdr *hdr, Elf_Shdr *sechdrs,
dest = l1_data_sram_alloc(s->sh_size);
mod->arch.data_a_l1 = dest;
if (dest == NULL) {
-   pr_err("L1 data memory allocation failed\n");
+   mod_err(mod, "L1 data memory allocation 
failed\n");
return -1;
}
memcpy(dest, (void *)s->sh_addr, s->sh_size);
@@ -68,7 +71,7 @@ module_frob_arch_sections(Elf_Ehdr *hdr, Elf_Shdr *sechdrs,
dest = l1_data_sram_zalloc(s->sh_size);
mod->arch.bss_a_l1 = dest;
if (dest == NULL) {
-   pr_err("L1 data memory allocation failed\n");
+   mod_err(mod, "L1 data memory allocation 
failed\n");
return -1;
}
 
@@ -77,7 +80,7 @@ module_frob_arch_sections(Elf_Ehdr *hdr, Elf_Shdr *sechdrs,
dest = l1_data_B_sram_alloc(s->sh_size);
mod->arch.data_b_l1 = dest;
if (dest == NULL) {
-   pr_err("L1 data memory allocation failed\n");
+   mod_err(mod, "L1 data memory allocation 
failed\n");
return -1;
}
memcpy(dest, (void *)s->sh_addr, s->sh_size);
@@ -87,7 +90,7 @@ module_frob_arch_sections(Elf_Ehdr *hdr, Elf_Shdr *sechdrs,
dest = l1_data_B_sram_alloc(s->sh_size);
mod->arch.bss_b_l1 = dest;
if (dest == NULL) {
-   pr_err("L1 data memory allocation failed\n");
+   mod_err(mod, "L1 data memory allocation 
failed\n");
return -1;
}
memset(dest, 0, s->sh_size);
@@ -99,7 +102,7 @@ module_frob_arch_sections(Elf_Ehdr *hdr, Elf_Shdr *sechdrs,
dest = l2_sram_alloc(s->sh_size);
mod->arch.text_l2 = dest;
if (dest == NULL) {
-   pr_err("L2 SRAM allocation failed\n");
+   mod_err(mod, "L2 SRAM allocation failed\n");
return -1;
}
memcpy(dest, (void *)s->sh_addr, s->sh_size);
@@ -111,7 +114,7 @@ module_frob_arch_sections(Elf_Ehdr *hdr, Elf_Shdr *sechdrs,
dest = l2_sram_alloc(s->sh_size);
mod->arch.data_l2 = dest;
if (dest == NULL) {
-  

Re: [rcu:rcu/next 97/97] arch/blackfin/kernel/module.c:20:25: error: expected ')' before 'fmt'

2017-05-30 Thread Paul E. McKenney
On Tue, May 30, 2017 at 06:41:48PM -0700, Joe Perches wrote:
> Hey Paul.
> 
> Can you please fix the mod_debug macro definition
> as described below?
> 
> Thanks.  Joe

Like this?  (Applied and pushed in any case.)

And hey, I missed it as well...

Thanx, Paul



commit 4f98aa416ea0b085a7582e9cd801e6c0e7325a71
Author: Paul E. McKenney 
Date:   Tue May 30 15:20:37 2017 -0700

module: Fix pr_fmt() bug for header use of printk

This commit removes the pr_fmt() macro, replacing it with mod_err() and
mod_debug() macros to avoid errors when using printk() from header files.

Signed-off-by: Joe Perches 
Signed-off-by: Paul E. McKenney 

diff --git a/arch/blackfin/kernel/module.c b/arch/blackfin/kernel/module.c
index 0188c933b155..15af5768c403 100644
--- a/arch/blackfin/kernel/module.c
+++ b/arch/blackfin/kernel/module.c
@@ -4,8 +4,6 @@
  * Licensed under the GPL-2 or later
  */
 
-#define pr_fmt(fmt) "module %s: " fmt, mod->name
-
 #include 
 #include 
 #include 
@@ -16,6 +14,11 @@
 #include 
 #include 
 
+#define mod_err(mod, fmt, ...) \
+   pr_err("module %s: " fmt, (mod)->name, ##__VA_ARGS__)
+#define mod_debug(mod, fmt, ...)   \
+   pr_debug("module %s: " fmt, (mod)->name, ##__VA_ARGS__)
+
 /* Transfer the section to the L1 memory */
 int
 module_frob_arch_sections(Elf_Ehdr *hdr, Elf_Shdr *sechdrs,
@@ -44,7 +47,7 @@ module_frob_arch_sections(Elf_Ehdr *hdr, Elf_Shdr *sechdrs,
dest = l1_inst_sram_alloc(s->sh_size);
mod->arch.text_l1 = dest;
if (dest == NULL) {
-   pr_err("L1 inst memory allocation failed\n");
+   mod_err(mod, "L1 inst memory allocation 
failed\n");
return -1;
}
dma_memcpy(dest, (void *)s->sh_addr, s->sh_size);
@@ -56,7 +59,7 @@ module_frob_arch_sections(Elf_Ehdr *hdr, Elf_Shdr *sechdrs,
dest = l1_data_sram_alloc(s->sh_size);
mod->arch.data_a_l1 = dest;
if (dest == NULL) {
-   pr_err("L1 data memory allocation failed\n");
+   mod_err(mod, "L1 data memory allocation 
failed\n");
return -1;
}
memcpy(dest, (void *)s->sh_addr, s->sh_size);
@@ -68,7 +71,7 @@ module_frob_arch_sections(Elf_Ehdr *hdr, Elf_Shdr *sechdrs,
dest = l1_data_sram_zalloc(s->sh_size);
mod->arch.bss_a_l1 = dest;
if (dest == NULL) {
-   pr_err("L1 data memory allocation failed\n");
+   mod_err(mod, "L1 data memory allocation 
failed\n");
return -1;
}
 
@@ -77,7 +80,7 @@ module_frob_arch_sections(Elf_Ehdr *hdr, Elf_Shdr *sechdrs,
dest = l1_data_B_sram_alloc(s->sh_size);
mod->arch.data_b_l1 = dest;
if (dest == NULL) {
-   pr_err("L1 data memory allocation failed\n");
+   mod_err(mod, "L1 data memory allocation 
failed\n");
return -1;
}
memcpy(dest, (void *)s->sh_addr, s->sh_size);
@@ -87,7 +90,7 @@ module_frob_arch_sections(Elf_Ehdr *hdr, Elf_Shdr *sechdrs,
dest = l1_data_B_sram_alloc(s->sh_size);
mod->arch.bss_b_l1 = dest;
if (dest == NULL) {
-   pr_err("L1 data memory allocation failed\n");
+   mod_err(mod, "L1 data memory allocation 
failed\n");
return -1;
}
memset(dest, 0, s->sh_size);
@@ -99,7 +102,7 @@ module_frob_arch_sections(Elf_Ehdr *hdr, Elf_Shdr *sechdrs,
dest = l2_sram_alloc(s->sh_size);
mod->arch.text_l2 = dest;
if (dest == NULL) {
-   pr_err("L2 SRAM allocation failed\n");
+   mod_err(mod, "L2 SRAM allocation failed\n");
return -1;
}
memcpy(dest, (void *)s->sh_addr, s->sh_size);
@@ -111,7 +114,7 @@ module_frob_arch_sections(Elf_Ehdr *hdr, Elf_Shdr *sechdrs,
dest = l2_sram_alloc(s->sh_size);
mod->arch.data_l2 = dest;
if (dest == NULL) {
-   pr_err("L2 SRAM allocation failed\n");
+ 

Re: [rcu:rcu/next 97/97] arch/blackfin/kernel/module.c:20:25: error: expected ')' before 'fmt'

2017-05-30 Thread Joe Perches
Hey Paul.

Can you please fix the mod_debug macro definition
as described below?

Thanks.  Joe

On Wed, 2017-05-31 at 08:48 +0800, kbuild test robot wrote:
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git 
> rcu/next
> head:   19223c8730d289cd4c65b46250b3e02a6752803c
> commit: 19223c8730d289cd4c65b46250b3e02a6752803c [97/97] module: Fix pr_fmt() 
> bug for header use of printk
> config: blackfin-allmodconfig (attached as .config)
> compiler: bfin-uclinux-gcc (GCC) 6.2.0
> reproduce:
> wget 
> https://raw.githubusercontent.com/01org/lkp-tests/master/sbin/make.cross -O 
> ~/bin/make.cross
> chmod +x ~/bin/make.cross
> git checkout 19223c8730d289cd4c65b46250b3e02a6752803c
> # save the attached .config to linux build tree
> make.cross ARCH=blackfin 
> 
> All error/warnings (new ones prefixed by >>):
> 
>In file included from include/linux/printk.h:329:0,
> from include/linux/kernel.h:13,
> from include/linux/list.h:8,
> from include/linux/module.h:9,
> from include/linux/moduleloader.h:5,
> from arch/blackfin/kernel/module.c:7:
>arch/blackfin/kernel/module.c: In function 'apply_relocate_add':
> > > arch/blackfin/kernel/module.c:20:25: error: expected ')' before 'fmt'
> 
>  pr_debug("module %s: " fmt, (mod)->name, ##__VA_ARGS__)
> ^
>include/linux/dynamic_debug.h:79:14: note: in definition of macro 
> 'DEFINE_DYNAMIC_DEBUG_METADATA_KEY'
>   .format = (fmt),\
[]
> vim +20 arch/blackfin/kernel/module.c
> 
[]
> 19#define mod_debug(mod, ...) 
> \

duh.

This line needs to be:

#define mod_debug(mod, fmt, ...)
\

so fmt is one of the arguments to mod_debug

>   > 20pr_debug("module %s: " fmt, (mod)->name, ##__VA_ARGS__)



Re: [rcu:rcu/next 97/97] arch/blackfin/kernel/module.c:20:25: error: expected ')' before 'fmt'

2017-05-30 Thread Joe Perches
Hey Paul.

Can you please fix the mod_debug macro definition
as described below?

Thanks.  Joe

On Wed, 2017-05-31 at 08:48 +0800, kbuild test robot wrote:
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git 
> rcu/next
> head:   19223c8730d289cd4c65b46250b3e02a6752803c
> commit: 19223c8730d289cd4c65b46250b3e02a6752803c [97/97] module: Fix pr_fmt() 
> bug for header use of printk
> config: blackfin-allmodconfig (attached as .config)
> compiler: bfin-uclinux-gcc (GCC) 6.2.0
> reproduce:
> wget 
> https://raw.githubusercontent.com/01org/lkp-tests/master/sbin/make.cross -O 
> ~/bin/make.cross
> chmod +x ~/bin/make.cross
> git checkout 19223c8730d289cd4c65b46250b3e02a6752803c
> # save the attached .config to linux build tree
> make.cross ARCH=blackfin 
> 
> All error/warnings (new ones prefixed by >>):
> 
>In file included from include/linux/printk.h:329:0,
> from include/linux/kernel.h:13,
> from include/linux/list.h:8,
> from include/linux/module.h:9,
> from include/linux/moduleloader.h:5,
> from arch/blackfin/kernel/module.c:7:
>arch/blackfin/kernel/module.c: In function 'apply_relocate_add':
> > > arch/blackfin/kernel/module.c:20:25: error: expected ')' before 'fmt'
> 
>  pr_debug("module %s: " fmt, (mod)->name, ##__VA_ARGS__)
> ^
>include/linux/dynamic_debug.h:79:14: note: in definition of macro 
> 'DEFINE_DYNAMIC_DEBUG_METADATA_KEY'
>   .format = (fmt),\
[]
> vim +20 arch/blackfin/kernel/module.c
> 
[]
> 19#define mod_debug(mod, ...) 
> \

duh.

This line needs to be:

#define mod_debug(mod, fmt, ...)
\

so fmt is one of the arguments to mod_debug

>   > 20pr_debug("module %s: " fmt, (mod)->name, ##__VA_ARGS__)