linux-arch.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Fengguang Wu <fengguang.wu@intel.com>
To: David Howells <dhowells@redhat.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>,
	Arnd Bergmann <arnd@arndb.de>,
	linux-arch@vger.kernel.org, Ralf Baechle <ralf@linux-mips.org>,
	Sam Ravnborg <sam@ravnborg.org>,
	uclinux-dist-devel@blackfin.uclinux.org,
	Mike Frysinger <vapier@gentoo.org>
Subject: Re: [PATCH] Make most arch asm/module.h files use asm-generic/module.h [ver #2]
Date: Thu, 19 Jul 2012 21:07:03 +0800	[thread overview]
Message-ID: <20120719130703.GA17751@localhost> (raw)
In-Reply-To: <31321.1342698046@warthog.procyon.org.uk>

On Thu, Jul 19, 2012 at 12:40:46PM +0100, David Howells wrote:
> 
> David Howells <dhowells@redhat.com> 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.

Thanks,
Fengguang

  reply	other threads:[~2012-07-19 13:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-18 14:50 [PATCH] Make most arch asm/module.h files use asm-generic/module.h [ver #2] David Howells
2012-07-19 11:40 ` David Howells
2012-07-19 13:07   ` Fengguang Wu [this message]
2012-07-19 13:30     ` Mike Frysinger
2012-07-20  8:13 ` Sam Ravnborg

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=20120719130703.GA17751@localhost \
    --to=fengguang.wu@intel.com \
    --cc=arnd@arndb.de \
    --cc=dhowells@redhat.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=ralf@linux-mips.org \
    --cc=rusty@rustcorp.com.au \
    --cc=sam@ravnborg.org \
    --cc=uclinux-dist-devel@blackfin.uclinux.org \
    --cc=vapier@gentoo.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 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).