Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751906AbbDAIRK (ORCPT ); Wed, 1 Apr 2015 04:17:10 -0400 Received: from [81.174.139.2] ([81.174.139.2]:59022 "EHLO mail.einon.net" rhost-flags-FAIL-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1750751AbbDAIRF (ORCPT ); Wed, 1 Apr 2015 04:17:05 -0400 X-Greylist: delayed 594 seconds by postgrey-1.27 at vger.kernel.org; Wed, 01 Apr 2015 04:17:05 EDT Date: Wed, 1 Apr 2015 09:05:52 +0100 From: Mark Einon To: Ingo Molnar Cc: Mark Einon , 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 Message-ID: <20150401080552.GA5498@leicester.auvation.com> References: <1427836812-7968-1-git-send-email-mark.einon@gmail.com> <1427839640-13584-1-git-send-email-mark.einon@gmail.com> <20150401075410.GA19758@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20150401075410.GA19758@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3524 Lines: 99 On Wed, Apr 01, 2015 at 09:54:10AM +0200, Ingo Molnar wrote: > > * Mark Einon 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 > > --- > > v2 - Move code to another #ifdef instead of creating a new ifdef pair after > > comment by Borislav Petkov . > > > > > > 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'. Sure, I can change this. > > + > > /* > > * 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? Ah, my bad - looks like I patched the wrong branch before resending. I'll do a v3 with the other change above. Mark -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/