Linux Input/HID development
 help / color / mirror / Atom feed
From: Denis Zaitceff <zaitceff@gmail.com>
To: vojtech@suse.cz, dmitry.torokhov@gmail.com
Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] atkbd.c: make the unknown key warnings controllable thru a config option
Date: Sun, 29 Jun 2008 22:54:23 +0600	[thread overview]
Message-ID: <20080629225423.A23524@ward.six> (raw)

The patch allows to configure off the logging of ATKBD_KEY_UNKNOWN
events.  This logging can be healthy, but usually it just pollutes the
kernel log.  And this logging may be _very_ massive.

Very probably that other (than atkbd) keyboard drivers may win from
the similar patches.

Please apply this patch.


--- drivers/input/keyboard/Kconfig
+++ drivers/input/keyboard/Kconfig
@@ -12,6 +12,15 @@ menuconfig INPUT_KEYBOARD
 
 if INPUT_KEYBOARD
 
+config KEYBOARD_VERBOSE_KEY_UNKNOWN
+	bool "Report unknown keys"
+	default n
+	help
+	  If Y, each press and release of any key unknown to the keyboard driver
+	  will be logged at the KERN_WARNING level.  This is really good if you
+	  want to study your keyboard, but may really flood your logs.
+	  Be warned!
+
 config KEYBOARD_ATKBD
 	tristate "AT keyboard" if EMBEDDED || !X86_PC
 	default y
--- drivers/input/keyboard/atkbd.c
+++ drivers/input/keyboard/atkbd.c
@@ -442,6 +442,7 @@ static irqreturn_t atkbd_interrupt(struc
 		case ATKBD_KEY_NULL:
 			break;
 		case ATKBD_KEY_UNKNOWN:
+#ifdef KEYBOARD_VERBOSE_KEY_UNKNOWN
 			printk(KERN_WARNING
 			       "atkbd.c: Unknown key %s (%s set %d, code %#x on %s).\n",
 			       atkbd->release ? "released" : "pressed",
@@ -450,6 +451,7 @@ static irqreturn_t atkbd_interrupt(struc
 			printk(KERN_WARNING
 			       "atkbd.c: Use 'setkeycodes %s%02x <keycode>' to make it known.\n",
 			       code & 0x80 ? "e0" : "", code & 0x7f);
+#endif
 			input_sync(dev);
 			break;
 		case ATKBD_SCR_1:

             reply	other threads:[~2008-06-29 16:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-29 16:54 Denis Zaitceff [this message]
2008-06-30 12:21 ` [PATCH] atkbd.c: make the unknown key warnings controllable thru a config option Dmitry Torokhov

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=20080629225423.A23524@ward.six \
    --to=zaitceff@gmail.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vojtech@suse.cz \
    /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