Skip to content

Commit

Permalink
usb: move usb_{hi,lo} helpers to header file.
Browse files Browse the repository at this point in the history
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
  • Loading branch information
kraxel committed Nov 28, 2013
1 parent 2b81ba5 commit 0b1fa34
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
10 changes: 0 additions & 10 deletions hw/usb/desc.c
Expand Up @@ -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)
{
Expand Down
11 changes: 11 additions & 0 deletions hw/usb/desc.h
Expand Up @@ -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);
Expand Down

0 comments on commit 0b1fa34

Please sign in to comment.