All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Einon <mark.einon@gmail.com>
To: x86@kernel.org
Cc: tglx@linutronix.de, mingo@kernel.org, bp@alien8.de,
	linux-kernel@vger.kernel.org, hpa@zytor.com,
	stuart.r.anderson@intel.com, Mark Einon <mark.einon@gmail.com>
Subject: [PATCH v3] x86, earlyprintk: Fix two 'defined but not used' compile warnings
Date: Wed,  1 Apr 2015 22:32:04 +0100	[thread overview]
Message-ID: <1427923924-22653-1-git-send-email-mark.einon@gmail.com> (raw)
In-Reply-To: <1427839640-13584-1-git-send-email-mark.einon@gmail.com>

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)
                     ^

Also convert a few related instances of uintXX_t to kernel specific uXX defines.

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>.

v3 - Fixed commit errors from v2, changed some uintXX_t data types to equivalent uXX.

 arch/x86/kernel/early_printk.c | 32 ++++++++++++++++----------------
 1 file changed, 16 insertions(+), 16 deletions(-)

diff --git a/arch/x86/kernel/early_printk.c b/arch/x86/kernel/early_printk.c
index f85e3fb..89427d8 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)
+{
+	u32 *vaddr = (u32 *)addr;
+	/* shift implied by pointer type */
+	writel(value, vaddr + offset);
+}
+
+static unsigned int mem32_serial_in(unsigned long addr, int offset)
+{
+	u32 *vaddr = (u32 *)addr;
+	/* shift implied by pointer type */
+	return readl(vaddr + offset);
+}
+
 /*
  * early_pci_serial_init()
  *
@@ -217,8 +217,8 @@ static __init void early_pci_serial_init(char *s)
 	unsigned divisor;
 	unsigned long baud = DEFAULT_BAUD;
 	u8 bus, slot, func;
-	uint32_t classcode, bar0;
-	uint16_t cmdreg;
+	u32 classcode, bar0;
+	u16 cmdreg;
 	char *e;
 
 
-- 
2.1.4


  parent reply	other threads:[~2015-04-01 21:32 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-31 21:20 [PATCH] x86, earlyprintk: Fix two 'defined but not used' compile warnings 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
2015-04-01  8:05     ` Mark Einon
2015-04-01 21:32   ` Mark Einon [this message]
2015-04-02  4:35     ` [PATCH v3] " 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=1427923924-22653-1-git-send-email-mark.einon@gmail.com \
    --to=mark.einon@gmail.com \
    --cc=bp@alien8.de \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.