linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [rcu:rcu/next 97/97] arch/blackfin/kernel/module.c:20:25: error: expected ')' before 'fmt'
@ 2017-05-31  0:48 kbuild test robot
  2017-05-31  1:41 ` Joe Perches
  0 siblings, 1 reply; 3+ messages in thread
From: kbuild test robot @ 2017-05-31  0:48 UTC (permalink / raw)
  To: Paul E. McKenney; +Cc: kbuild-all, linux-kernel, Joe Perches

[-- Attachment #1: Type: text/plain, Size: 13230 bytes --]

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),    \
                 ^~~
   include/linux/dynamic_debug.h:124:2: note: in expansion of macro 'DEFINE_DYNAMIC_DEBUG_METADATA'
     DEFINE_DYNAMIC_DEBUG_METADATA(descriptor, fmt);  \
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/printk.h:333:2: note: in expansion of macro 'dynamic_pr_debug'
     dynamic_pr_debug(fmt, ##__VA_ARGS__)
     ^~~~~~~~~~~~~~~~
>> arch/blackfin/kernel/module.c:20:2: note: in expansion of macro 'pr_debug'
     pr_debug("module %s: " fmt, (mod)->name, ##__VA_ARGS__)
     ^~~~~~~~
>> arch/blackfin/kernel/module.c:163:2: note: in expansion of macro 'mod_debug'
     mod_debug(mod, "applying relocate section %u to %u\n",
     ^~~~~~~~~
   In file included from include/linux/kernel.h:13:0,
                    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:20:25: error: expected ')' before 'fmt'
     pr_debug("module %s: " fmt, (mod)->name, ##__VA_ARGS__)
                            ^
   include/linux/printk.h:285:21: note: in definition of macro 'pr_fmt'
    #define pr_fmt(fmt) fmt
                        ^~~
   include/linux/printk.h:333:2: note: in expansion of macro 'dynamic_pr_debug'
     dynamic_pr_debug(fmt, ##__VA_ARGS__)
     ^~~~~~~~~~~~~~~~
>> arch/blackfin/kernel/module.c:20:2: note: in expansion of macro 'pr_debug'
     pr_debug("module %s: " fmt, (mod)->name, ##__VA_ARGS__)
     ^~~~~~~~
>> arch/blackfin/kernel/module.c:163:2: note: in expansion of macro 'mod_debug'
     mod_debug(mod, "applying relocate section %u to %u\n",
     ^~~~~~~~~
>> arch/blackfin/kernel/module.c:20:11: warning: format '%s' expects a matching 'char *' argument [-Wformat=]
     pr_debug("module %s: " fmt, (mod)->name, ##__VA_ARGS__)
              ^
   include/linux/printk.h:285:21: note: in definition of macro 'pr_fmt'
    #define pr_fmt(fmt) fmt
                        ^~~
   include/linux/printk.h:333:2: note: in expansion of macro 'dynamic_pr_debug'
     dynamic_pr_debug(fmt, ##__VA_ARGS__)
     ^~~~~~~~~~~~~~~~
>> arch/blackfin/kernel/module.c:20:2: note: in expansion of macro 'pr_debug'
     pr_debug("module %s: " fmt, (mod)->name, ##__VA_ARGS__)
     ^~~~~~~~
>> arch/blackfin/kernel/module.c:163:2: note: in expansion of macro 'mod_debug'
     mod_debug(mod, "applying relocate section %u to %u\n",
     ^~~~~~~~~
   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: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),    \
                 ^~~
   include/linux/dynamic_debug.h:124:2: note: in expansion of macro 'DEFINE_DYNAMIC_DEBUG_METADATA'
     DEFINE_DYNAMIC_DEBUG_METADATA(descriptor, fmt);  \
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/printk.h:333:2: note: in expansion of macro 'dynamic_pr_debug'
     dynamic_pr_debug(fmt, ##__VA_ARGS__)
     ^~~~~~~~~~~~~~~~
>> arch/blackfin/kernel/module.c:20:2: note: in expansion of macro 'pr_debug'
     pr_debug("module %s: " fmt, (mod)->name, ##__VA_ARGS__)
     ^~~~~~~~
   arch/blackfin/kernel/module.c:186:3: note: in expansion of macro 'mod_debug'
      mod_debug(mod, "location is %lx, value is %lx type is %d\n",
      ^~~~~~~~~
   In file included from include/linux/kernel.h:13:0,
                    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:20:25: error: expected ')' before 'fmt'
     pr_debug("module %s: " fmt, (mod)->name, ##__VA_ARGS__)
                            ^
   include/linux/printk.h:285:21: note: in definition of macro 'pr_fmt'
    #define pr_fmt(fmt) fmt
                        ^~~
   include/linux/printk.h:333:2: note: in expansion of macro 'dynamic_pr_debug'
     dynamic_pr_debug(fmt, ##__VA_ARGS__)
     ^~~~~~~~~~~~~~~~
>> arch/blackfin/kernel/module.c:20:2: note: in expansion of macro 'pr_debug'
     pr_debug("module %s: " fmt, (mod)->name, ##__VA_ARGS__)
     ^~~~~~~~
   arch/blackfin/kernel/module.c:186:3: note: in expansion of macro 'mod_debug'
      mod_debug(mod, "location is %lx, value is %lx type is %d\n",
      ^~~~~~~~~
>> arch/blackfin/kernel/module.c:20:11: warning: format '%s' expects a matching 'char *' argument [-Wformat=]
     pr_debug("module %s: " fmt, (mod)->name, ##__VA_ARGS__)
              ^
   include/linux/printk.h:285:21: note: in definition of macro 'pr_fmt'
    #define pr_fmt(fmt) fmt
                        ^~~
   include/linux/printk.h:333:2: note: in expansion of macro 'dynamic_pr_debug'
     dynamic_pr_debug(fmt, ##__VA_ARGS__)
     ^~~~~~~~~~~~~~~~
>> arch/blackfin/kernel/module.c:20:2: note: in expansion of macro 'pr_debug'
     pr_debug("module %s: " fmt, (mod)->name, ##__VA_ARGS__)
     ^~~~~~~~
   arch/blackfin/kernel/module.c:186:3: note: in expansion of macro 'mod_debug'
      mod_debug(mod, "location is %lx, value is %lx type is %d\n",
      ^~~~~~~~~

vim +20 arch/blackfin/kernel/module.c

     1	/*
     2	 * Copyright 2004-2009 Analog Devices Inc.
     3	 *
     4	 * Licensed under the GPL-2 or later
     5	 */
     6	
   > 7	#include <linux/moduleloader.h>
     8	#include <linux/elf.h>
     9	#include <linux/vmalloc.h>
    10	#include <linux/fs.h>
    11	#include <linux/string.h>
    12	#include <linux/kernel.h>
    13	#include <asm/dma.h>
    14	#include <asm/cacheflush.h>
    15	#include <linux/uaccess.h>
    16	
    17	#define mod_err(mod, fmt, ...)						\
    18		pr_err("module %s: " fmt, (mod)->name, ##__VA_ARGS__)
    19	#define mod_debug(mod, ...)						\
  > 20		pr_debug("module %s: " fmt, (mod)->name, ##__VA_ARGS__)
    21	
    22	/* Transfer the section to the L1 memory */
    23	int
    24	module_frob_arch_sections(Elf_Ehdr *hdr, Elf_Shdr *sechdrs,
    25				  char *secstrings, struct module *mod)
    26	{
    27		/*
    28		 * XXX: sechdrs are vmalloced in kernel/module.c
    29		 * and would be vfreed just after module is loaded,
    30		 * so we hack to keep the only information we needed
    31		 * in mod->arch to correctly free L1 I/D sram later.
    32		 * NOTE: this breaks the semantic of mod->arch structure.
    33		 */
    34		Elf_Shdr *s, *sechdrs_end = sechdrs + hdr->e_shnum;
    35		void *dest;
    36	
    37		for (s = sechdrs; s < sechdrs_end; ++s) {
    38			const char *shname = secstrings + s->sh_name;
    39	
    40			if (s->sh_size == 0)
    41				continue;
    42	
    43			if (!strcmp(".l1.text", shname) ||
    44			    (!strcmp(".text", shname) &&
    45			     (hdr->e_flags & EF_BFIN_CODE_IN_L1))) {
    46	
    47				dest = l1_inst_sram_alloc(s->sh_size);
    48				mod->arch.text_l1 = dest;
    49				if (dest == NULL) {
    50					mod_err(mod, "L1 inst memory allocation failed\n");
    51					return -1;
    52				}
    53				dma_memcpy(dest, (void *)s->sh_addr, s->sh_size);
    54	
    55			} else if (!strcmp(".l1.data", shname) ||
    56			           (!strcmp(".data", shname) &&
    57			            (hdr->e_flags & EF_BFIN_DATA_IN_L1))) {
    58	
    59				dest = l1_data_sram_alloc(s->sh_size);
    60				mod->arch.data_a_l1 = dest;
    61				if (dest == NULL) {
    62					mod_err(mod, "L1 data memory allocation failed\n");
    63					return -1;
    64				}
    65				memcpy(dest, (void *)s->sh_addr, s->sh_size);
    66	
    67			} else if (!strcmp(".l1.bss", shname) ||
    68			           (!strcmp(".bss", shname) &&
    69			            (hdr->e_flags & EF_BFIN_DATA_IN_L1))) {
    70	
    71				dest = l1_data_sram_zalloc(s->sh_size);
    72				mod->arch.bss_a_l1 = dest;
    73				if (dest == NULL) {
    74					mod_err(mod, "L1 data memory allocation failed\n");
    75					return -1;
    76				}
    77	
    78			} else if (!strcmp(".l1.data.B", shname)) {
    79	
    80				dest = l1_data_B_sram_alloc(s->sh_size);
    81				mod->arch.data_b_l1 = dest;
    82				if (dest == NULL) {
    83					mod_err(mod, "L1 data memory allocation failed\n");
    84					return -1;
    85				}
    86				memcpy(dest, (void *)s->sh_addr, s->sh_size);
    87	
    88			} else if (!strcmp(".l1.bss.B", shname)) {
    89	
    90				dest = l1_data_B_sram_alloc(s->sh_size);
    91				mod->arch.bss_b_l1 = dest;
    92				if (dest == NULL) {
    93					mod_err(mod, "L1 data memory allocation failed\n");
    94					return -1;
    95				}
    96				memset(dest, 0, s->sh_size);
    97	
    98			} else if (!strcmp(".l2.text", shname) ||
    99			           (!strcmp(".text", shname) &&
   100			            (hdr->e_flags & EF_BFIN_CODE_IN_L2))) {
   101	
   102				dest = l2_sram_alloc(s->sh_size);
   103				mod->arch.text_l2 = dest;
   104				if (dest == NULL) {
   105					mod_err(mod, "L2 SRAM allocation failed\n");
   106					return -1;
   107				}
   108				memcpy(dest, (void *)s->sh_addr, s->sh_size);
   109	
   110			} else if (!strcmp(".l2.data", shname) ||
   111			           (!strcmp(".data", shname) &&
   112			            (hdr->e_flags & EF_BFIN_DATA_IN_L2))) {
   113	
   114				dest = l2_sram_alloc(s->sh_size);
   115				mod->arch.data_l2 = dest;
   116				if (dest == NULL) {
   117					mod_err(mod, "L2 SRAM allocation failed\n");
   118					return -1;
   119				}
   120				memcpy(dest, (void *)s->sh_addr, s->sh_size);
   121	
   122			} else if (!strcmp(".l2.bss", shname) ||
   123			           (!strcmp(".bss", shname) &&
   124			            (hdr->e_flags & EF_BFIN_DATA_IN_L2))) {
   125	
   126				dest = l2_sram_zalloc(s->sh_size);
   127				mod->arch.bss_l2 = dest;
   128				if (dest == NULL) {
   129					mod_err(mod, "L2 SRAM allocation failed\n");
   130					return -1;
   131				}
   132	
   133			} else
   134				continue;
   135	
   136			s->sh_flags &= ~SHF_ALLOC;
   137			s->sh_addr = (unsigned long)dest;
   138		}
   139	
   140		return 0;
   141	}
   142	
   143	/*************************************************************************/
   144	/* FUNCTION : apply_relocate_add                                         */
   145	/* ABSTRACT : Blackfin specific relocation handling for the loadable     */
   146	/*            modules. Modules are expected to be .o files.              */
   147	/*            Arithmetic relocations are handled.                        */
   148	/*            We do not expect LSETUP to be split and hence is not       */
   149	/*            handled.                                                   */
   150	/*            R_BFIN_BYTE and R_BFIN_BYTE2 are also not handled as the   */
   151	/*            gas does not generate it.                                  */
   152	/*************************************************************************/
   153	int
   154	apply_relocate_add(Elf_Shdr *sechdrs, const char *strtab,
   155			   unsigned int symindex, unsigned int relsec,
   156			   struct module *mod)
   157	{
   158		unsigned int i;
   159		Elf32_Rela *rel = (void *)sechdrs[relsec].sh_addr;
   160		Elf32_Sym *sym;
   161		unsigned long location, value, size;
   162	
 > 163		mod_debug(mod, "applying relocate section %u to %u\n",
   164			  relsec, sechdrs[relsec].sh_info);
   165	
   166		for (i = 0; i < sechdrs[relsec].sh_size / sizeof(*rel); i++) {

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 44745 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [rcu:rcu/next 97/97] arch/blackfin/kernel/module.c:20:25: error: expected ')' before 'fmt'
  2017-05-31  0:48 [rcu:rcu/next 97/97] arch/blackfin/kernel/module.c:20:25: error: expected ')' before 'fmt' kbuild test robot
@ 2017-05-31  1:41 ` Joe Perches
  2017-05-31  1:53   ` Paul E. McKenney
  0 siblings, 1 reply; 3+ messages in thread
From: Joe Perches @ 2017-05-31  1:41 UTC (permalink / raw)
  To: kbuild test robot, Paul E. McKenney; +Cc: kbuild-all, linux-kernel

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

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [rcu:rcu/next 97/97] arch/blackfin/kernel/module.c:20:25: error: expected ')' before 'fmt'
  2017-05-31  1:41 ` Joe Perches
@ 2017-05-31  1:53   ` Paul E. McKenney
  0 siblings, 0 replies; 3+ messages in thread
From: Paul E. McKenney @ 2017-05-31  1:53 UTC (permalink / raw)
  To: Joe Perches; +Cc: kbuild test robot, kbuild-all, linux-kernel

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 <paulmck@linux.vnet.ibm.com>
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 <joe@perches.com>
    Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>

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 <linux/moduleloader.h>
 #include <linux/elf.h>
 #include <linux/vmalloc.h>
@@ -16,6 +14,11 @@
 #include <asm/cacheflush.h>
 #include <linux/uaccess.h>
 
+#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");
+				mod_err(mod, "L2 SRAM allocation failed\n");
 				return -1;
 			}
 			memcpy(dest, (void *)s->sh_addr, s->sh_size);
@@ -123,7 +126,7 @@ module_frob_arch_sections(Elf_Ehdr *hdr, Elf_Shdr *sechdrs,
 			dest = l2_sram_zalloc(s->sh_size);
 			mod->arch.bss_l2 = dest;
 			if (dest == NULL) {
-				pr_err("L2 SRAM allocation failed\n");
+				mod_err(mod, "L2 SRAM allocation failed\n");
 				return -1;
 			}
 
@@ -157,8 +160,8 @@ apply_relocate_add(Elf_Shdr *sechdrs, const char *strtab,
 	Elf32_Sym *sym;
 	unsigned long location, value, size;
 
-	pr_debug("applying relocate section %u to %u\n",
-		relsec, sechdrs[relsec].sh_info);
+	mod_debug(mod, "applying relocate section %u to %u\n",
+		  relsec, sechdrs[relsec].sh_info);
 
 	for (i = 0; i < sechdrs[relsec].sh_size / sizeof(*rel); i++) {
 		/* This is where to make the change */
@@ -174,14 +177,14 @@ apply_relocate_add(Elf_Shdr *sechdrs, const char *strtab,
 
 #ifdef CONFIG_SMP
 		if (location >= COREB_L1_DATA_A_START) {
-			pr_err("cannot relocate in L1: %u (SMP kernel)\n",
+			mod_err(mod, "cannot relocate in L1: %u (SMP kernel)\n",
 				ELF32_R_TYPE(rel[i].r_info));
 			return -ENOEXEC;
 		}
 #endif
 
-		pr_debug("location is %lx, value is %lx type is %d\n",
-			location, value, ELF32_R_TYPE(rel[i].r_info));
+		mod_debug(mod, "location is %lx, value is %lx type is %d\n",
+			  location, value, ELF32_R_TYPE(rel[i].r_info));
 
 		switch (ELF32_R_TYPE(rel[i].r_info)) {
 
@@ -200,12 +203,12 @@ apply_relocate_add(Elf_Shdr *sechdrs, const char *strtab,
 		case R_BFIN_PCREL12_JUMP:
 		case R_BFIN_PCREL12_JUMP_S:
 		case R_BFIN_PCREL10:
-			pr_err("unsupported relocation: %u (no -mlong-calls?)\n",
+			mod_err(mod, "unsupported relocation: %u (no -mlong-calls?)\n",
 				ELF32_R_TYPE(rel[i].r_info));
 			return -ENOEXEC;
 
 		default:
-			pr_err("unknown relocation: %u\n",
+			mod_err(mod, "unknown relocation: %u\n",
 				ELF32_R_TYPE(rel[i].r_info));
 			return -ENOEXEC;
 		}
@@ -222,7 +225,7 @@ apply_relocate_add(Elf_Shdr *sechdrs, const char *strtab,
 			isram_memcpy((void *)location, &value, size);
 			break;
 		default:
-			pr_err("invalid relocation for %#lx\n", location);
+			mod_err(mod, "invalid relocation for %#lx\n", location);
 			return -ENOEXEC;
 		}
 	}

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-05-31  1:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-31  0:48 [rcu:rcu/next 97/97] arch/blackfin/kernel/module.c:20:25: error: expected ')' before 'fmt' kbuild test robot
2017-05-31  1:41 ` Joe Perches
2017-05-31  1:53   ` Paul E. McKenney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).