From mboxrd@z Thu Jan 1 00:00:00 1970 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 From: Gerd Hoffmann 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> Subject: [Qemu-devel] [PATCH 4/6] usb: move usb_{hi, lo} helpers to header file. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Gerd Hoffmann 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); -- 1.8.3.1