Skip to content

Commit

Permalink
[media] ati_remote: fix check for a weird byte
Browse files Browse the repository at this point in the history
The ati_remote_dump() function tries to not print "Weird byte" warning
for 1-byte responses that contain 0xff or 0x00, but it doesn't work
properly as it simply falls back to the "Weird data" warning in the else
clause.

Fix that by adding an inner if clause.

Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Anssi Hannula authored and Mauro Carvalho Chehab committed Sep 22, 2011
1 parent 44fd0b6 commit 0224e04
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions drivers/media/rc/ati_remote.c
Original file line number Diff line number Diff line change
Expand Up @@ -273,9 +273,10 @@ static struct usb_driver ati_remote_driver = {
static void ati_remote_dump(struct device *dev, unsigned char *data,
unsigned int len)
{
if ((len == 1) && (data[0] != (unsigned char)0xff) && (data[0] != 0x00))
dev_warn(dev, "Weird byte 0x%02x\n", data[0]);
else if (len == 4)
if (len == 1) {
if (data[0] != (unsigned char)0xff && data[0] != 0x00)
dev_warn(dev, "Weird byte 0x%02x\n", data[0]);
} else if (len == 4)
dev_warn(dev, "Weird key %02x %02x %02x %02x\n",
data[0], data[1], data[2], data[3]);
else
Expand Down

0 comments on commit 0224e04

Please sign in to comment.