Skip to contentSkip to conversation

Staging: lirc: remove unneeded variable

PATCH In review Dan Carpenter 2 participants 4 messages Aug 10, 2010 – Aug 17, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Staging: lirc: remove unneeded variable

We never use control_req so I removed it.

drivers/staging/lirc/lirc_imon.c +0 -3
index 6649325..cb5699c 100644
@@ -320,7 +320,6 @@ static int send_packet(struct imon_context *context)
 	unsigned int pipe;
 	int interval = 0;
 	int retval = 0;
-	struct usb_ctrlrequest *control_req = NULL;
 
 	/* Check if we need to use control or interrupt urb */
 	pipe = usb_sndintpipe(context->usbdev,
@@ -355,8 +354,6 @@ static int send_packet(struct imon_context *context)
 			err("%s: packet tx failed (%d)", __func__, retval);
 	}
 
-	kfree(control_req);
-
 	return retval;
 }
 
#2 lore raw
In reply to Dan Carpenter
Quoted 8 lines · Jarod Wilson
Quoted 3 lines · Dan Carpenter

We never use control_req so I removed it.

Leftover cruft from when lirc_imon also supported the devices now covered by the ir-core imon driver.

Speak of left over stuff, it's weird that I didn't notice this before but gcc complains about an unitialized variable in imon_incoming_packet().

drivers/staging/lirc/lirc_imon.c: In function ‘imon_incoming_packet’:
drivers/staging/lirc/lirc_imon.c:661: warning: ‘chunk_num’ may be used
uninitialized in this function

I don't know how to fix that, but it looks important.

regards,
dan carpenter

Quoted 6 lines
Signature · 2 lines
Jarod Wilson
[email protected]
#3 lore raw
In reply to Dan Carpenter
Quoted 14 lines · Dan Carpenter
Quoted 8 lines · Jarod Wilson
Quoted 3 lines · Dan Carpenter

We never use control_req so I removed it.

Leftover cruft from when lirc_imon also supported the devices now covered by the ir-core imon driver.

Speak of left over stuff, it's weird that I didn't notice this before but gcc complains about an unitialized variable in imon_incoming_packet().

Quoted 5 lines

drivers/staging/lirc/lirc_imon.c: In function ‘imon_incoming_packet’:
drivers/staging/lirc/lirc_imon.c:661: warning: ‘chunk_num’ may be used
uninitialized in this function

I don't know how to fix that, but it looks important.

Ew. Yeah, that doesn't look so hot like it is right now. The old lirc_imon driver had chunk_num = buf[7], and made much more extensive use of chunk_num. Simply removing chunk_num and using buf[7] should be fine.

---
 drivers/staging/lirc/lirc_imon.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/staging/lirc/lirc_imon.c +2 -2
index 6649325..2351c88 100644
@@ -599,7 +599,7 @@ static void imon_incoming_packet(struct imon_context *context,
 	struct device *dev = context->driver->dev;
 	int octet, bit;
 	unsigned char mask;
-	int i, chunk_num;
+	int i;
 
 	/*
 	 * just bail out if no listening IR client
@@ -658,7 +658,7 @@ static void imon_incoming_packet(struct imon_context *context,
 		}
 	}
 
-	if (chunk_num = 10) {
+	if (buf[7] = 10) {
 		if (context->rx.count) {
 			submit_data(context);
 			context->rx.count = 0;
Signature · 2 lines
Jarod Wilson
[email protected]