Re: [PATCH] Make most arch asm/module.h files use asm-generic/module.h [ver #2]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thursday 19 July 2012 09:07:03 Fengguang Wu wrote:
> On Thu, Jul 19, 2012 at 12:40:46PM +0100, David Howells wrote:
> > David Howells <dhowells@xxxxxxxxxx> wrote:
> > > +static inline int apply_relocate(Elf_Shdr *sechdrs,
> > > +				 const char *strtab,
> > > +				 unsigned int symindex,
> > > +				 unsigned int relsec,
> > > +				 struct module *me)
> > > +{
> > > +	pr_err("module %s: REL relocation unsupported\n", me->name);
> > > +	return -ENOEXEC;
> > > +}
> > 
> > Turns out you cannot use pr_err() and friends in a header file, lest it
> > get included in a file that defines pr_fmt() to be something
> > inconvenient.
> > 
> > Thanks to Fengguang and his GIT tree cruncher for finding this in
> > Blackfin with the BF526-EZBRD_defconfig.
> 
> For completeness, here are the error messages and David's comments:
> >> In file included from arch/blackfin/kernel/module.c:9:0:
> >> include/linux/moduleloader.h: In function 'apply_relocate':
> >> include/linux/moduleloader.h:48:2: error: 'mod' undeclared (first use in
> >> this function) include/linux/moduleloader.h:48:2: note: each undeclared
> >> identifier is reported only once for each function it appears in
> >
> >pr_err() is the problem.  If you're in a file that defines pr_fmt then it
> >will
> >
> >use that.  At the top of arch/blackfin/kernel/module.c:
> >        #define pr_fmt(fmt) "module %s: " fmt, mod->name
> >
> >I guess you can't use pr_err() in header files.

if it were "mod" instead of "me" in the variable list, i imagine it'd compile 
OK ;)
-mike

Attachment: signature.asc
Description: This is a digitally signed message part.


[Index of Archives]     [Linux Kernel]     [Kernel Newbies]     [x86 Platform Driver]     [Netdev]     [Linux Wireless]     [Netfilter]     [Bugtraq]     [Linux Filesystems]     [Yosemite Discussion]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]

  Powered by Linux