All of lore.kernel.org
 help / color / mirror / Atom feed
From: William Steidtmann <billstei@hbci.com>
To: Mauro Carvalho Chehab <mchehab@redhat.com>
Cc: linux-media@vger.kernel.org, Sean Young <sean@mess.org>
Subject: Patch mceusb.c -- Kernel 3.9-rc6
Date: Mon, 15 Apr 2013 16:17:11 -0500	[thread overview]
Message-ID: <516C6E57.4090600@hbci.com> (raw)

Fix mceusb_cmdsize() which returns incorrect datasize=0 for sub-commands MCE_RSP_GETPORTSTATUS, MCE_RSP_GETWAKESOURCE, MCE_RSP_EQDEVDETAILS, MCE_RSP_EQEMVER, and MCE_RSP_EQIRNUMPORTS.  Change mceusb_cmdsize() name to reflect that it returns data size not cmd size.

Signed-off-by: William Steidtmann <billstei@hbci.com>
Acked-by:

--- a/drivers/media/rc/mceusb.c	2013-04-07 22:49:54.000000000 -0500
+++ b/drivers/media/rc/mceusb.c	2013-04-14 12:18:30.000000000 -0500
@@ -482,7 +482,7 @@ static char SET_RX_SENSOR[]	= {MCE_CMD_P
  				   MCE_RSP_EQIRRXPORTEN, 0x00};
  */
  
-static int mceusb_cmdsize(u8 cmd, u8 subcmd)
+static int mceusb_cmd_datasize(u8 cmd, u8 subcmd)
  {
  	int datasize = 0;
  
@@ -493,6 +493,9 @@ static int mceusb_cmdsize(u8 cmd, u8 sub
  		break;
  	case MCE_CMD_PORT_SYS:
  		switch (subcmd) {
+		case MCE_RSP_GETPORTSTATUS:
+			datasize = 5;
+			break;
  		case MCE_RSP_EQWAKEVERSION:
  			datasize = 4;
  			break;
@@ -500,6 +503,9 @@ static int mceusb_cmdsize(u8 cmd, u8 sub
  			datasize = 2;
  			break;
  		case MCE_RSP_EQWAKESUPPORT:
+		case MCE_RSP_GETWAKESOURCE:
+		case MCE_RSP_EQDEVDETAILS:
+		case MCE_RSP_EQEMVER:
  			datasize = 1;
  			break;
  		}
@@ -509,6 +515,7 @@ static int mceusb_cmdsize(u8 cmd, u8 sub
  		case MCE_RSP_EQIRCFS:
  		case MCE_RSP_EQIRTIMEOUT:
  		case MCE_RSP_EQIRRXCFCNT:
+		case MCE_RSP_EQIRNUMPORTS:
  			datasize = 2;
  			break;
  		case MCE_CMD_SIG_END:
@@ -968,7 +975,7 @@ static void mceusb_process_ir_data(struc
  	for (; i < buf_len; i++) {
  		switch (ir->parser_state) {
  		case SUBCMD:
-			ir->rem = mceusb_cmdsize(ir->cmd, ir->buf_in[i]);
+			ir->rem = mceusb_cmd_datasize(ir->cmd, ir->buf_in[i]);
  			mceusb_dev_printdata(ir, ir->buf_in, i - 1,
  					     ir->rem + 2, false);
  			mceusb_handle_command(ir, i);



             reply	other threads:[~2013-04-15 21:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-15 21:17 William Steidtmann [this message]
2013-04-16 10:05 ` Patch mceusb.c -- Kernel 3.9-rc6 Sean Young

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=516C6E57.4090600@hbci.com \
    --to=billstei@hbci.com \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@redhat.com \
    --cc=sean@mess.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.