From: Ingo Molnar <mingo@elte.hu>
To: Ingo Brueckl <ib@wupperonline.de>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
Jesper Juhl <jj@chaosbits.net>, Tom Spink <tspink@gmail.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] compile time warnings
Date: Fri, 2 Jan 2009 15:42:48 +0100 [thread overview]
Message-ID: <20090102144248.GA13621@elte.hu> (raw)
In-Reply-To: <495e192c@wupperonline.de>
* Ingo Brueckl <ib@wupperonline.de> wrote:
> Ingo Molnar <mingo@elte.hu> writes:
>
> > yes, with a small nit:
> >>
> >> +static inline void permanent_kmaps_init(pgd_t *pgd_base)
> >> +{
> >> + (void) pgd_base;
>
> > there's no need for this line - this is not a macro, so the function
> > parameter does not have to be 'used'.
>
> I live and learn.
>
> fix compiler warning in arch/x86/mm/init_32.c
applied to tip/x86/cleanups, thanks! Find below the final form of the
commit.
Ingo
---------------->
>From a9067d537615d534dcef06c0d819472e43a0d152 Mon Sep 17 00:00:00 2001
From: Ingo Brueckl <ib@wupperonline.de>
Date: Fri, 2 Jan 2009 14:42:00 +0100
Subject: [PATCH] x86: convert permanent_kmaps_init() from macro to inline
Impact: cleanup
This compiler warning:
arch/x86/mm/init_32.c:515: warning: unused variable 'pgd_base'
triggers because permanent_kmaps_init() is a CPP macro in the
!CONFIG_HIGHMEM case, that does not tell the compiler that the
'pgd_base' parameter is used.
Convert permanent_kmaps_init() (and set_highmem_pages_init()) to
C inline functions - which gives the parameter a proper type and
which gets rid of the compiler warning as well.
Signed-off-by: Ingo Brueckl <ib@wupperonline.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
arch/x86/mm/init_32.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/arch/x86/mm/init_32.c b/arch/x86/mm/init_32.c
index 800e1d9..ad98b18 100644
--- a/arch/x86/mm/init_32.c
+++ b/arch/x86/mm/init_32.c
@@ -434,8 +434,12 @@ static void __init set_highmem_pages_init(void)
#endif /* !CONFIG_NUMA */
#else
-# define permanent_kmaps_init(pgd_base) do { } while (0)
-# define set_highmem_pages_init() do { } while (0)
+static inline void permanent_kmaps_init(pgd_t *pgd_base)
+{
+}
+static inline void set_highmem_pages_init(void)
+{
+}
#endif /* CONFIG_HIGHMEM */
void __init native_pagetable_setup_start(pgd_t *base)
next prev parent reply other threads:[~2009-01-02 14:43 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-01 21:13 compile time warnings Ingo Brueckl
2009-01-01 22:52 ` Jesper Juhl
2009-01-02 1:35 ` Tom Spink
2009-01-02 1:39 ` Harvey Harrison
2009-01-02 2:07 ` Jesper Juhl
2009-01-02 9:57 ` Ingo Molnar
2009-01-02 12:53 ` [PATCH] " Ingo Brueckl
2009-01-02 13:01 ` Ingo Molnar
2009-01-02 13:42 ` Ingo Brueckl
2009-01-02 14:42 ` Ingo Molnar [this message]
2009-01-02 16:07 ` Jesper Juhl
2009-01-02 16:10 ` Jesper Juhl
2009-01-02 2:48 ` Ingo Brueckl
2009-01-02 20:03 ` Robert Hancock
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=20090102144248.GA13621@elte.hu \
--to=mingo@elte.hu \
--cc=ib@wupperonline.de \
--cc=jj@chaosbits.net \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@linux-foundation.org \
--cc=tspink@gmail.com \
/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