From: Rakib Mullick <rakib.mullick@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: jirislaby@gmail.com, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH -mm] char, moxa: Make isabrds variable global.
Date: Sat, 7 Nov 2009 11:08:35 +0600 [thread overview]
Message-ID: <b9df5fa10911062108l2334be64ka0777e89c6dbc17f@mail.gmail.com> (raw)
In-Reply-To: <b9df5fa10911022029q197a0c5dkbbda609f4e41287@mail.gmail.com>
On 11/3/09, Rakib Mullick <rakib.mullick@gmail.com> wrote:
> When CONFIG_MODULE=n and CONFIG_PCI=n, then variable
> isabrds becomes unused variable. So place it outside
> moxa_init solves this problem.
>
> We were warned by the following warning:
>
> drivers/char/moxa.c: In function `moxa_init':
> drivers/char/moxa.c:1012: warning: unused variable `isabrds'
Hi Andrew, after applying this one, it introduce a new warning:
drivers/char/moxa.c:1010: warning: 'isabrds' defined but not used
And while compiling moxa.c we are also warned by the following warnings:
drivers/char/moxa.c:81: warning: 'moxa_brdname' defined but not used
drivers/char/moxa.c:818: warning: 'moxa_init_board' defined but not used
To fix this warnings we need to properly #ifdef above functions.
So after applying the following patch - moxa.c compiles cleanly.
Would you mind check this out, Andrew?
Fix compilation warning when CONFIG_PCI=n.
Signed-off-by: Rakib Mullick <rakib.mullick@gmail.com>
----
--- linus/drivers/char/moxa.c 2009-11-06 17:12:13.000000000 +0600
+++ rakib/drivers/char/moxa.c 2009-11-06 17:47:18.000000000 +0600
@@ -78,6 +78,7 @@ enum {
MOXA_BOARD_CP204J,
};
+#if defined MODULE || defined CONFIG_PCI
static char *moxa_brdname[] =
{
"C218 Turbo PCI series",
@@ -87,6 +88,9 @@ static char *moxa_brdname[] =
"CP-204J series",
};
+static unsigned int __initdata isabrds;
+#endif
+
#ifdef CONFIG_PCI
static struct pci_device_id moxa_pcibrds[] = {
{ PCI_DEVICE(PCI_VENDOR_ID_MOXA, PCI_DEVICE_ID_MOXA_C218),
@@ -419,6 +423,7 @@ static DEFINE_SPINLOCK(moxa_lock);
* HW init
*/
+#if defined MODULE || defined CONFIG_PCI
static int moxa_check_fw_model(struct moxa_board_conf *brd, u8 model)
{
switch (brd->boardType) {
@@ -878,6 +883,7 @@ err_free:
err:
return ret;
}
+#endif
static void moxa_board_deinit(struct moxa_board_conf *brd)
{
@@ -1009,7 +1015,6 @@ static struct pci_driver moxa_pci_driver
static int __init moxa_init(void)
{
- unsigned int isabrds = 0;
int retval = 0;
printk(KERN_INFO "MOXA Intellio family driver version %s\n",
next prev parent reply other threads:[~2009-11-07 5:08 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-03 4:29 Rakib Mullick
2009-11-07 5:08 ` Rakib Mullick [this message]
2009-11-07 10:27 ` Jiri Slaby
2009-11-09 2:06 ` Rakib Mullick
2009-11-09 8:20 ` Jiri Slaby
2009-11-10 17:42 ` Rakib Mullick
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=b9df5fa10911062108l2334be64ka0777e89c6dbc17f@mail.gmail.com \
--to=rakib.mullick@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®