Received: from eggs.gnu.org ([140.186.70.92]:41238) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QS0fE-0007h6-M9 for qemu-devel@nongnu.org; Thu, 02 Jun 2011 01:41:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QS0fC-0003Ww-Vx for qemu-devel@nongnu.org; Thu, 02 Jun 2011 01:41:48 -0400 Received: from smtpout3.three.com.au ([202.124.68.59]:36257) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QS0fC-0003Wj-54 for qemu-devel@nongnu.org; Thu, 02 Jun 2011 01:41:46 -0400 From: Brad Hards Date: Thu, 2 Jun 2011 15:41:08 +1000 Message-Id: <1306993270-24144-6-git-send-email-bradh@frogmouth.net> In-Reply-To: <1306993270-24144-1-git-send-email-bradh@frogmouth.net> References: <1306993270-24144-1-git-send-email-bradh@frogmouth.net> Subject: [Qemu-devel] [PATCH 5/7] usb-uvc: Add spaces around & List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: claunia@claunia.com, qemu-devel@nongnu.org Cc: Brad Hards As requested by Blue Swirl (2010-06-10 17:46:16) Signed-off-by: Brad Hards --- hw/usb-uvc.c | 30 +++++++++++++++++++----------- 1 files changed, 19 insertions(+), 11 deletions(-) diff --git a/hw/usb-uvc.c b/hw/usb-uvc.c index 5437a13..661eb1a 100644 --- a/hw/usb-uvc.c +++ b/hw/usb-uvc.c @@ -507,7 +507,7 @@ static int usb_uvc_handle_control(USBDevice *dev, USBPacket *p, int request, if (((index & 0xFF) == 0x01) && (((value & 0xFF00) == 0x0100) || ((value & 0xFF00) == 0x0200))) { DPRINTF("USB Request: Get video control minimum setting " - "attribute for interface %d\n", index&0xFF); + "attribute for interface %d\n", index & 0xFF); if (length != 26) { DPRINTF("USB Request: Requested %d bytes, expected 26 " @@ -542,7 +542,8 @@ static int usb_uvc_handle_control(USBDevice *dev, USBPacket *p, int request, data[24] = 0x00; data[25] = 0x00; ret = 26; - } else if ((index&0xFF00) == 0x0400 && (value&0xFF00) == 0x0100) { + } else if (((index & 0xFF00) == 0x0400) && + ((value & 0xFF00) == 0x0100)) { /* Setting input */ DPRINTF("USB Request: Asking for minimum input\n"); if (length != 1) { @@ -553,7 +554,8 @@ static int usb_uvc_handle_control(USBDevice *dev, USBPacket *p, int request, data[0] = 0; ret = 1; - } else if ((index&0xFF00) == 0x0500 && (value&0xFF00) == 0x0200) { + } else if (((index & 0xFF00) == 0x0500) && + ((value & 0xFF00) == 0x0200)) { /* PU_BRIGHTNESS_CONTROL of PROCESSING_UNIT */ DPRINTF("USB Request: Asking for minimum brightness\n"); if (length != 2) { @@ -571,7 +573,7 @@ static int usb_uvc_handle_control(USBDevice *dev, USBPacket *p, int request, break; case UVCGetVideoControl | USB_UVC_GET_MAX: if (((index & 0xFF) == 0x01) && (((value & 0xFF00) == 0x0100) || - ((value & 0xFF00) == 0x0200))) { + ((value & 0xFF00) == 0x0200))) { DPRINTF("USB Request: Get video control maximum setting " "attribute for interface %d\n", index & 0xFF); @@ -620,7 +622,8 @@ static int usb_uvc_handle_control(USBDevice *dev, USBPacket *p, int request, data[0] = 1; ret = 1; - } else if ((index&0xFF00) == 0x0500 && (value&0xFF00) == 0x0200) { + } else if (((index & 0xFF00) == 0x0500) && + ((value & 0xFF00) == 0x0200)) { /* PU_BRIGHTNESS_CONTROL of PROCESSING_UNIT */ DPRINTF("USB Request: Asking for maximum brightness\n"); if (length != 2) { @@ -640,7 +643,7 @@ static int usb_uvc_handle_control(USBDevice *dev, USBPacket *p, int request, if (((index & 0xFF) == 0x01) && ((value & 0xFF00) == 0x0100 || (value & 0xFF00) == 0x0200)) { DPRINTF("USB Request: Get video control default setting " - "attribute for interface %d\n", index&0xFF); + "attribute for interface %d\n", index & 0xFF); if (length != 26) { DPRINTF("USB Request: Requested %d bytes, expected 26 " @@ -675,7 +678,8 @@ static int usb_uvc_handle_control(USBDevice *dev, USBPacket *p, int request, data[24] = 0x00; data[25] = 0x00; ret = 26; - } else if ((index&0xFF00) == 0x0400 && (value&0xFF00) == 0x0100) { + } else if (((index & 0xFF00) == 0x0400) && + ((value & 0xFF00) == 0x0100)) { /* Setting input */ DPRINTF("USB Request: Asking for default input\n"); if (length != 1) { @@ -686,7 +690,8 @@ static int usb_uvc_handle_control(USBDevice *dev, USBPacket *p, int request, data[0] = 0; ret = 1; - } else if ((index&0xFF00) == 0x0500 && (value&0xFF00) == 0x0200) { + } else if (((index & 0xFF00) == 0x0500) && + ((value & 0xFF00) == 0x0200)) { /* PU_BRIGHTNESS_CONTROL of PROCESSING_UNIT */ DPRINTF("USB Request: Asking for default brightness\n"); if (length != 2) { @@ -741,7 +746,8 @@ static int usb_uvc_handle_control(USBDevice *dev, USBPacket *p, int request, first_bulk_packet = 1; ret = 26; - } else if ((index&0xFF00) == 0x0400 && (value&0xFF00) == 0x0100) { + } else if (((index & 0xFF00) == 0x0400) && + ((value & 0xFF00) == 0x0100)) { /* Setting input */ DPRINTF("Setting input to %d\n", data[0]); if (length != 1) { @@ -752,7 +758,8 @@ static int usb_uvc_handle_control(USBDevice *dev, USBPacket *p, int request, s->current_input = data[0]; ret = 1; - } else if ((index&0xFF00) == 0x0500 && (value&0xFF00) == 0x0200) { + } else if (((index & 0xFF00) == 0x0500) && + ((value & 0xFF00) == 0x0200)) { /* PU_BRIGHTNESS_CONTROL of PROCESSING_UNIT */ DPRINTF("USB Request: Setting brightness, " "value stays the same\n"); @@ -768,7 +775,8 @@ static int usb_uvc_handle_control(USBDevice *dev, USBPacket *p, int request, } break; case UVCGetVideoControl | USB_UVC_GET_RES: - if ((index&0xFF00) == 0x0500 && (value&0xFF00) == 0x0200) { + if (((index & 0xFF00) == 0x0500) && + ((value & 0xFF00) == 0x0200)) { /* PU_BRIGHTNESS_CONTROL of PROCESSING_UNIT */ DPRINTF("USB Request: Asking for brightness resolution\n"); if (length != 2) { -- 1.7.4.1