mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Rakib Mullick <rakib.mullick@gmail.com>
To: Jiri Slaby <jirislaby@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH -mm] char, moxa: Make isabrds variable global.
Date: Tue, 10 Nov 2009 23:42:28 +0600	[thread overview]
Message-ID: <b9df5fa10911100942o4768484euae363173adcfab0f@mail.gmail.com> (raw)
In-Reply-To: <4AF7D0DD.5030604@gmail.com>

On 11/9/09, Jiri Slaby <jirislaby@gmail.com> wrote:
> Actually I'm idiot. I forgot, that today people can just pass "module
>  parameters" on the kernel cmdline even on !MODULE in the
>  KBUILD_MODNAME.param manner. So no, a better fix is to remove !MODULE
>  ifdefs completely.
>
>  Sorry for the confusion.

Okay, hope this will be right. Checkout the following patch.

 moxa: Remove #ifdef MODULE completely.

 We can pass "module parameters" on the kernel command
line even when !MODULE. So, #ifdef MODULE becomes
obsolete. Also move the declaration moxa_board_conf at the
start of the function, since we were hit by the following warning.

drivers/char/moxa.c: In function `moxa_init':
drivers/char/moxa.c:1040: warning: ISO C90 forbids mixed declarations and code

Signed-off-by: Rakib Mullick<rakib.mullick@gmail.com>
---

--- linus/drivers/char/moxa.c	2009-11-10 23:30:13.000000000 +0600
+++ rakib/drivers/char/moxa.c	2009-11-11 00:37:55.000000000 +0600
@@ -165,24 +165,22 @@ static struct mon_str moxaLog;
 static unsigned int moxaFuncTout = HZ / 2;
 static unsigned int moxaLowWaterChk;
 static DEFINE_MUTEX(moxa_openlock);
-/* Variables for insmod */
-#ifdef MODULE
+
 static unsigned long baseaddr[MAX_BOARDS];
 static unsigned int type[MAX_BOARDS];
 static unsigned int numports[MAX_BOARDS];
-#endif

 MODULE_AUTHOR("William Chen");
 MODULE_DESCRIPTION("MOXA Intellio Family Multiport Board Device Driver");
 MODULE_LICENSE("GPL");
-#ifdef MODULE
+
 module_param_array(type, uint, NULL, 0);
 MODULE_PARM_DESC(type, "card type: C218=2, C320=4");
 module_param_array(baseaddr, ulong, NULL, 0);
 MODULE_PARM_DESC(baseaddr, "base address");
 module_param_array(numports, uint, NULL, 0);
 MODULE_PARM_DESC(numports, "numports (ignored for C218)");
-#endif
+
 module_param(ttymajor, int, 0);

 /*
@@ -1011,6 +1009,8 @@ static int __init moxa_init(void)
 {
 	unsigned int isabrds = 0;
 	int retval = 0;
+	struct moxa_board_conf *brd = moxa_boards;
+	unsigned int i;

 	printk(KERN_INFO "MOXA Intellio family driver version %s\n",
 			MOXA_VERSION);
@@ -1038,10 +1038,7 @@ static int __init moxa_init(void)
 	}

 	/* Find the boards defined from module args. */
-#ifdef MODULE
-	{
-	struct moxa_board_conf *brd = moxa_boards;
-	unsigned int i;
+
 	for (i = 0; i < MAX_BOARDS; i++) {
 		if (!baseaddr[i])
 			break;
@@ -1074,8 +1071,6 @@ static int __init moxa_init(void)
 			isabrds++;
 		}
 	}
-	}
-#endif

 #ifdef CONFIG_PCI
 	retval = pci_register_driver(&moxa_pci_driver);

      reply	other threads:[~2009-11-10 17:42 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
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 [this message]

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=b9df5fa10911100942o4768484euae363173adcfab0f@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®