From patchwork Thu Jun 2 05:41:08 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brad Hards X-Patchwork-Id: 98353 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 8F0F2B6F99 for ; Thu, 2 Jun 2011 16:04:14 +1000 (EST) Received: from localhost ([::1]:46196 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QS10r-0003kJ-IW for incoming@patchwork.ozlabs.org; Thu, 02 Jun 2011 02:04:09 -0400 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 Received: from auumvs2fe02.three.com.au (auhgvpsmtp.three.com.au [10.176.77.86]) by smtpout3.three.com.au (Postfix) with ESMTP id F1296A0757; Thu, 2 Jun 2011 15:41:44 +1000 (EST) Received: from localhost.localdomain ([10.224.20.109]) by auumvs2fe02.three.com.au with ESMTP id p525g7Lq013689-p525g7Lw013689; Thu, 2 Jun 2011 15:42:28 +1000 From: Brad Hards To: claunia@claunia.com, qemu-devel@nongnu.org Date: Thu, 2 Jun 2011 15:41:08 +1000 Message-Id: <1306993270-24144-6-git-send-email-bradh@frogmouth.net> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1306993270-24144-1-git-send-email-bradh@frogmouth.net> References: <1306993270-24144-1-git-send-email-bradh@frogmouth.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Received-From: 202.124.68.59 Cc: Brad Hards Subject: [Qemu-devel] [PATCH 5/7] usb-uvc: Add spaces around & X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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) {