From: Ingo Molnar <mingo@kernel.org>
To: Mark Einon <mark.einon@gmail.com>
Cc: x86@kernel.org, tglx@linutronix.de, bp@alien8.de,
linux-kernel@vger.kernel.org, mingo@redhat.com, hpa@zytor.com,
stuart.r.anderson@intel.com
Subject: Re: [PATCH v2] x86, earlyprintk: Fix two 'defined but not used' compile warnings
Date: Wed, 1 Apr 2015 09:54:10 +0200 [thread overview]
Message-ID: <20150401075410.GA19758@gmail.com> (raw)
In-Reply-To: <1427839640-13584-1-git-send-email-mark.einon@gmail.com>
* Mark Einon <mark.einon@gmail.com> wrote:
> Two static functions are only used if CONFIG_PCI is defined,so only build them
> if this is the case. Fixes the build warnings:
>
> arch/x86/kernel/early_printk.c:98:13: warning: ‘mem32_serial_out’ defined but not used [-Wunused-function]
> static void mem32_serial_out(unsigned long addr, int offset, int value)
> ^
> arch/x86/kernel/early_printk.c:105:21: warning: ‘mem32_serial_in’ defined but not used [-Wunused-function]
> static unsigned int mem32_serial_in(unsigned long addr, int offset)
> ^
>
> Signed-off-by: Mark Einon <mark.einon@gmail.com>
> ---
> v2 - Move code to another #ifdef instead of creating a new ifdef pair after
> comment by Borislav Petkov <bp@alien8.de>.
>
>
> arch/x86/kernel/early_printk.c | 34 ++++++++++++++++++++--------------
> 1 file changed, 20 insertions(+), 14 deletions(-)
>
> diff --git a/arch/x86/kernel/early_printk.c b/arch/x86/kernel/early_printk.c
> index f85e3fb..cb2bab2 100644
> --- a/arch/x86/kernel/early_printk.c
> +++ b/arch/x86/kernel/early_printk.c
> @@ -95,20 +95,6 @@ static unsigned long early_serial_base = 0x3f8; /* ttyS0 */
> #define DLL 0 /* Divisor Latch Low */
> #define DLH 1 /* Divisor latch High */
>
> -static void mem32_serial_out(unsigned long addr, int offset, int value)
> -{
> - uint32_t *vaddr = (uint32_t *)addr;
> - /* shift implied by pointer type */
> - writel(value, vaddr + offset);
> -}
> -
> -static unsigned int mem32_serial_in(unsigned long addr, int offset)
> -{
> - uint32_t *vaddr = (uint32_t *)addr;
> - /* shift implied by pointer type */
> - return readl(vaddr + offset);
> -}
> -
> static unsigned int io_serial_in(unsigned long addr, int offset)
> {
> return inb(addr + offset);
> @@ -205,6 +191,20 @@ static __init void early_serial_init(char *s)
> }
>
> #ifdef CONFIG_PCI
> +static void mem32_serial_out(unsigned long addr, int offset, int value)
> +{
> + uint32_t *vaddr = (uint32_t *)addr;
> + /* shift implied by pointer type */
> + writel(value, vaddr + offset);
> +}
> +
> +static unsigned int mem32_serial_in(unsigned long addr, int offset)
> +{
> + uint32_t *vaddr = (uint32_t *)addr;
> + /* shift implied by pointer type */
> + return readl(vaddr + offset);
> +}
btw., while at it, this should use 'u32'.
> +
> /*
> * early_pci_serial_init()
> *
> @@ -375,6 +375,12 @@ static int __init setup_early_printk(char *buf)
> if (!strncmp(buf, "xen", 3))
> early_console_register(&xenboot_console, keep);
> #endif
> +#ifdef CONFIG_EARLY_PRINTK_INTEL_MID
> + if (!strncmp(buf, "hsu", 3)) {
> + hsu_early_console_init(buf + 3);
> + early_console_register(&early_hsu_console, keep);
> + }
> +#endif
> #ifdef CONFIG_EARLY_PRINTK_EFI
> if (!strncmp(buf, "efi", 3))
> early_console_register(&early_efi_console, keep);
huh?
Thanks,
Ingo
next prev parent reply other threads:[~2015-04-01 7:54 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-31 21:20 [PATCH] " Mark Einon
2015-03-31 21:45 ` Borislav Petkov
2015-03-31 22:07 ` [PATCH v2] " Mark Einon
2015-04-01 7:54 ` Ingo Molnar [this message]
2015-04-01 8:05 ` Mark Einon
2015-04-01 21:32 ` [PATCH v3] " Mark Einon
2015-04-02 4:35 ` Borislav Petkov
2015-04-03 14:06 ` [tip:x86/cleanups] x86/earlyprintk: Put CONFIG_PCI-only functions under the #ifdef tip-bot for Mark Einon
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=20150401075410.GA19758@gmail.com \
--to=mingo@kernel.org \
--cc=bp@alien8.de \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.einon@gmail.com \
--cc=mingo@redhat.com \
--cc=stuart.r.anderson@intel.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.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
Powered by JetHome