From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753305AbbCaVrR (ORCPT ); Tue, 31 Mar 2015 17:47:17 -0400 Received: from mail.skyhub.de ([78.46.96.112]:42735 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753069AbbCaVrK (ORCPT ); Tue, 31 Mar 2015 17:47:10 -0400 Date: Tue, 31 Mar 2015 23:45:13 +0200 From: Borislav Petkov To: Mark Einon Cc: x86@kernel.org, tglx@linutronix.de, linux-kernel@vger.kernel.org, mingo@redhat.com, hpa@zytor.com, stuart.r.anderson@intel.com Subject: Re: [PATCH] x86, earlyprintk: Fix two 'defined but not used' compile warnings Message-ID: <20150331214513.GA3728@pd.tnic> References: <1427836812-7968-1-git-send-email-mark.einon@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1427836812-7968-1-git-send-email-mark.einon@gmail.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 31, 2015 at 10:20:12PM +0100, 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 > --- > arch/x86/kernel/early_printk.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/arch/x86/kernel/early_printk.c b/arch/x86/kernel/early_printk.c > index f85e3fb..6a69625 100644 > --- a/arch/x86/kernel/early_printk.c > +++ b/arch/x86/kernel/early_printk.c > @@ -95,6 +95,7 @@ static unsigned long early_serial_base = 0x3f8; /* ttyS0 */ > #define DLL 0 /* Divisor Latch Low */ > #define DLH 1 /* Divisor latch High */ > > +#ifdef CONFIG_PCI > static void mem32_serial_out(unsigned long addr, int offset, int value) > { > uint32_t *vaddr = (uint32_t *)addr; > @@ -108,6 +109,7 @@ static unsigned int mem32_serial_in(unsigned long addr, int offset) > /* shift implied by pointer type */ > return readl(vaddr + offset); > } > +#endif I'm sceptical we ever build x86 with CONFIG_PCI disabled but whatever. Instead of adding another #ifdef CONFIG_PCI, please move those two functions right over early_pci_serial_init() inside the #ifdef CONFIG_PCI there. Thanks. -- Regards/Gruss, Boris. ECO tip #101: Trim your mails when you reply. --