mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Kevin Baradon <kevin.baradon@gmail.com>
To: mchehab@redhat.com
Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
	Kevin Baradon <kevin.baradon@gmail.com>
Subject: [PATCH 2/2] media/rc/imon.c: avoid flooding syslog with "unknown keypress" when keypad is pressed
Date: Sun, 24 Feb 2013 21:19:30 +0100	[thread overview]
Message-ID: <1361737170-4687-3-git-send-email-kevin.baradon@gmail.com> (raw)
In-Reply-To: <1361737170-4687-1-git-send-email-kevin.baradon@gmail.com>

My 15c2:0036 device floods syslog when a keypad key is pressed:

Feb 18 19:00:57 homeserver kernel: imon 5-1:1.0: imon_incoming_packet: unknown keypress, code 0x100fff2
Feb 18 19:00:57 homeserver kernel: imon 5-1:1.0: imon_incoming_packet: unknown keypress, code 0x100fef2
Feb 18 19:00:57 homeserver kernel: imon 5-1:1.0: imon_incoming_packet: unknown keypress, code 0x100fff2
Feb 18 19:00:57 homeserver kernel: imon 5-1:1.0: imon_incoming_packet: unknown keypress, code 0x100fff2
Feb 18 19:00:57 homeserver kernel: imon 5-1:1.0: imon_incoming_packet: unknown keypress, code 0x100fff2

This patch lowers severity of this message when key appears to be coming from keypad.

Signed-off-by: Kevin Baradon <kevin.baradon@gmail.com>
---
 drivers/media/rc/imon.c |   15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/drivers/media/rc/imon.c b/drivers/media/rc/imon.c
index a3e66a0..bca03d4 100644
--- a/drivers/media/rc/imon.c
+++ b/drivers/media/rc/imon.c
@@ -1499,7 +1499,7 @@ static void imon_incoming_packet(struct imon_context *ictx,
 	int i;
 	u64 scancode;
 	int press_type = 0;
-	int msec;
+	int msec, is_pad_key = 0;
 	struct timeval t;
 	static struct timeval prev_time = { 0, 0 };
 	u8 ktype;
@@ -1562,6 +1562,7 @@ static void imon_incoming_packet(struct imon_context *ictx,
 	    ((len == 8) && (buf[0] & 0x40) &&
 	     !(buf[1] & 0x1 || buf[1] >> 2 & 0x1))) {
 		len = 8;
+		is_pad_key = 1;
 		imon_pad_to_keys(ictx, buf);
 	}
 
@@ -1625,8 +1626,16 @@ static void imon_incoming_packet(struct imon_context *ictx,
 
 unknown_key:
 	spin_unlock_irqrestore(&ictx->kc_lock, flags);
-	dev_info(dev, "%s: unknown keypress, code 0x%llx\n", __func__,
-		 (long long)scancode);
+	/*
+	 * On some devices syslog is flooded with unknown keypresses when keypad
+	 * is pressed. Lower message severity in that case.
+	 */
+	if (!is_pad_key)
+		dev_info(dev, "%s: unknown keypress, code 0x%llx\n", __func__,
+			 (long long)scancode);
+	else
+		dev_dbg(dev, "%s: unknown keypad keypress, code 0x%llx\n",
+			__func__, (long long)scancode);
 	return;
 
 not_input_data:
-- 
1.7.10.4


  parent reply	other threads:[~2013-02-24 20:46 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-24 20:19 [PATCH 0/2] Improve imon LCD/VFD driver to better support 15c2:0036 Kevin Baradon
2013-02-24 20:19 ` [PATCH 1/2] media/rc/imon.c: make send_packet() delay configurable Kevin Baradon
2013-03-14 15:01   ` Mauro Carvalho Chehab
2013-03-17 15:06     ` Kevin Baradon
2013-02-24 20:19 ` Kevin Baradon [this message]
2013-03-14 15:18   ` [PATCH 2/2] media/rc/imon.c: avoid flooding syslog with "unknown keypress" when keypad is pressed Mauro Carvalho Chehab
2013-03-14 15:18   ` Mauro Carvalho Chehab
2013-03-17 15:09     ` Kevin Baradon

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=1361737170-4687-3-git-send-email-kevin.baradon@gmail.com \
    --to=kevin.baradon@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@redhat.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

all inboxes | Powered by JetHome®