From: Li Zefan <lizf@cn.fujitsu.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: jirislaby@gmail.com, LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH] mxser: fix compile warning building without CONFIG_PCI
Date: Sun, 03 Feb 2008 10:59:44 +0800 [thread overview]
Message-ID: <47A52E20.7000608@cn.fujitsu.com> (raw)
When build without CONFIG_PIC, got the following warnings:
drivers/char/mxser.c: In function 'mxser_init':
drivers/char/mxser.c:698: warning: unused variable 'devnum'
drivers/char/mxser.c:698: warning: unused variable 'busnum'
drivers/char/mxser.c:697: warning: unused variable 'index'
drivers/char/mxser.c:696: warning: unused variable 'pdev'
drivers/char/mxser.c:695: warning: unused variable 'n'
Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
---
drivers/char/mxser.c | 14 ++++++--------
1 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/drivers/char/mxser.c b/drivers/char/mxser.c
index fd0abef..b2cc93d 100644
--- a/drivers/char/mxser.c
+++ b/drivers/char/mxser.c
@@ -692,10 +692,7 @@ static int mxser_get_PCI_conf(int busnum, int devnum, int board_type, struct mxs
static int mxser_init(void)
{
- int i, m, retval, b, n;
- struct pci_dev *pdev = NULL;
- int index;
- unsigned char busnum, devnum;
+ int i, m, retval, b;
struct mxser_hwconf hwconf;
mxvar_sdriver = alloc_tty_driver(MXSER_PORTS + 1);
@@ -834,10 +831,11 @@ static int mxser_init(void)
/* start finding PCI board here */
#ifdef CONFIG_PCI
- n = ARRAY_SIZE(mxser_pcibrds) - 1;
- index = 0;
b = 0;
- while (b < n) {
+ while (b < ARRAY_SIZE(mxser_pcibrds)-1) {
+ unsigned char busnum, devnum;
+ struct pci_dev *pdev;
+
pdev = pci_get_device(mxser_pcibrds[b].vendor,
mxser_pcibrds[b].device, pdev);
if (pdev == NULL) {
@@ -850,7 +848,7 @@ static int mxser_init(void)
printk(KERN_INFO "Found MOXA %s board(BusNo=%d,DevNo=%d)\n",
mxser_brdname[(int) (mxser_pcibrds[b].driver_data) - 1],
busnum, devnum >> 3);
- index++;
+
if (m >= MXSER_BOARDS)
printk(KERN_ERR
"Too many Smartio/Industio family boards find "
--
1.5.4.rc3
next reply other threads:[~2008-02-03 3:01 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-03 2:59 Li Zefan [this message]
2008-02-03 6:17 ` [PATCH] mxser: fix compile warning building without CONFIG_PCI Jiri Slaby
2008-02-03 6:20 ` Li Zefan
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=47A52E20.7000608@cn.fujitsu.com \
--to=lizf@cn.fujitsu.com \
--cc=akpm@linux-foundation.org \
--cc=jirislaby@gmail.com \
--cc=linux-kernel@vger.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.