From patchwork Wed Nov 20 14:35:26 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 292773 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 152A62C0084 for ; Thu, 21 Nov 2013 01:36:50 +1100 (EST) Received: from localhost ([::1]:54968 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vj8tY-0002pM-KK for incoming@patchwork.ozlabs.org; Wed, 20 Nov 2013 09:36:44 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44155) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vj8so-0002d8-MH for qemu-devel@nongnu.org; Wed, 20 Nov 2013 09:36:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vj8sc-0002Zk-Fi for qemu-devel@nongnu.org; Wed, 20 Nov 2013 09:35:58 -0500 Received: from mx1.redhat.com ([209.132.183.28]:15786) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vj8sa-0002Z4-S9 for qemu-devel@nongnu.org; Wed, 20 Nov 2013 09:35:46 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id rAKEZi6p002668 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 20 Nov 2013 09:35:44 -0500 Received: from nilsson.home.kraxel.org (vpn1-6-90.ams2.redhat.com [10.36.6.90]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id rAKEZhAL000493; Wed, 20 Nov 2013 09:35:43 -0500 Received: by nilsson.home.kraxel.org (Postfix, from userid 500) id 0B793818F2; Wed, 20 Nov 2013 15:35:41 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Wed, 20 Nov 2013 15:35:26 +0100 Message-Id: <1384958128-22878-6-git-send-email-kraxel@redhat.com> In-Reply-To: <1384958128-22878-1-git-send-email-kraxel@redhat.com> References: <1384958128-22878-1-git-send-email-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Gerd Hoffmann Subject: [Qemu-devel] [PATCH 4/6] usb: move usb_{hi, lo} helpers to header file. 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 Signed-off-by: Gerd Hoffmann --- hw/usb/desc.c | 10 ---------- hw/usb/desc.h | 11 +++++++++++ 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/hw/usb/desc.c b/hw/usb/desc.c index 5dbe754..f18a043 100644 --- a/hw/usb/desc.c +++ b/hw/usb/desc.c @@ -6,16 +6,6 @@ /* ------------------------------------------------------------------ */ -static uint8_t usb_lo(uint16_t val) -{ - return val & 0xff; -} - -static uint8_t usb_hi(uint16_t val) -{ - return (val >> 8) & 0xff; -} - int usb_desc_device(const USBDescID *id, const USBDescDevice *dev, uint8_t *dest, size_t len) { diff --git a/hw/usb/desc.h b/hw/usb/desc.h index ddd3e74..81327b0 100644 --- a/hw/usb/desc.h +++ b/hw/usb/desc.h @@ -194,6 +194,17 @@ struct USBDesc { #define USB_DESC_FLAG_SUPER (1 << 1) +/* little helpers */ +static inline uint8_t usb_lo(uint16_t val) +{ + return val & 0xff; +} + +static inline uint8_t usb_hi(uint16_t val) +{ + return (val >> 8) & 0xff; +} + /* generate usb packages from structs */ int usb_desc_device(const USBDescID *id, const USBDescDevice *dev, uint8_t *dest, size_t len);