public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Bernhard Walle <bwalle@suse.de>
To: Randy Dunlap <randy.dunlap@oracle.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org, Andi Kleen <ak@suse.de>
Subject: Re: [PATCH] blink: Only blink when parameter is set
Date: Mon, 18 Jun 2007 09:18:19 +0200	[thread overview]
Message-ID: <20070618071819.GA9953@suse.de> (raw)
In-Reply-To: <20070617212601.38f952fe.randy.dunlap@oracle.com>

* Randy Dunlap <randy.dunlap@oracle.com> [2007-06-18 06:26]:
> > +static int blink = 0;
> 
> no need to init to 0.

Does it harm?

> > +module_param(blink, bool, S_IRUGO);
> > +MODULE_PARM_DESC(blink, "Enable blinking (without that, the module does nothing)\n");
> 
> unneeded "\n"

Fixed. Please use the following patch.

-----

This patch in the blink driver changes the module to only blink when
the parameter 'blink' is set to true. This is to allow the module to be
compiled in the kernel and not as module.

As the blink module was initially written for kdump, and as the kernel is
relocatable on lots of architectures, there's no need to compile a separate
kdump kernel. The blinking can now enabled via the boot command line
for the kdump kernel when necessary.

The patch also adds some author/license information and marks the init function
as '__init'.

Signed-off-by: Bernhard Walle <bwalle@suse.de>

---
 drivers/misc/blink.c |   15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

--- a/drivers/misc/blink.c
+++ b/drivers/misc/blink.c
@@ -3,6 +3,10 @@
 #include <linux/timer.h>
 #include <linux/jiffies.h>
 
+static int blink;
+module_param(blink, bool, S_IRUGO);
+MODULE_PARM_DESC(blink, "Enable blinking (without that, the module does nothing)");
+
 static void do_blink(unsigned long data);
 
 static DEFINE_TIMER(blink_timer, do_blink, 0 ,0);
@@ -16,12 +20,19 @@ static void do_blink(unsigned long data)
 	add_timer(&blink_timer);
 }
 
-static int blink_init(void)
+static int __init blink_init(void)
 {
 	printk(KERN_INFO "Enabling keyboard blinking\n");
-	do_blink(0);
+
+	if (blink)
+		do_blink(0);
+
 	return 0;
 }
 
 module_init(blink_init);
 
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Andi Kleen <ak@suse.de>");
+MODULE_DESCRIPTION("Blinks the keyboard LEDs");
+

  reply	other threads:[~2007-06-18  7:18 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-17  8:39 [PATCH] blink: Only blink when parameter is set Bernhard Walle
2007-06-17 16:11 ` Arjan van de Ven
2007-06-18  4:26 ` Randy Dunlap
2007-06-18  7:18   ` Bernhard Walle [this message]
2007-06-18 14:43     ` Randy Dunlap
2007-06-20 20:16 ` Pavel Machek
2007-06-20 23:51   ` Jiri Kosina
2007-06-21  0:20     ` Pavel Machek
2007-06-21  0:24       ` Jiri Kosina
2007-06-21  2:56         ` Dmitry Torokhov
2007-06-22  8:58           ` Pavel Machek

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=20070618071819.GA9953@suse.de \
    --to=bwalle@suse.de \
    --cc=ak@suse.de \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=randy.dunlap@oracle.com \
    /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