Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 292741
b: refs/heads/master
c: 24fa9a9
h: refs/heads/master
i:
  292739: cbee7d4
v: v3
  • Loading branch information
Matt Fleming authored and H. Peter Anvin committed Feb 28, 2012
1 parent dc299ce commit d12bdaa
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 30 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 92f42c50f227ad228f815a8f4eec872524dae3a5
refs/heads/master: 24fa9a9d6d70ef7ef7087dce472a8f43a9078da5
2 changes: 1 addition & 1 deletion trunk/tools/usb/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
CC = $(CROSS_COMPILE)gcc
PTHREAD_LIBS = -lpthread
WARNINGS = -Wall -Wextra
CFLAGS = $(WARNINGS) -g $(PTHREAD_LIBS)
CFLAGS = $(WARNINGS) -g $(PTHREAD_LIBS) -I../include

all: testusb ffs-test
%: %.c
Expand Down
29 changes: 1 addition & 28 deletions trunk/tools/usb/ffs-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include <tools/le_byteshift.h>

#include "../../include/linux/usb/functionfs.h"

Expand All @@ -47,34 +48,6 @@
#define le32_to_cpu(x) le32toh(x)
#define le16_to_cpu(x) le16toh(x)

static inline __u16 get_unaligned_le16(const void *_ptr)
{
const __u8 *ptr = _ptr;
return ptr[0] | (ptr[1] << 8);
}

static inline __u32 get_unaligned_le32(const void *_ptr)
{
const __u8 *ptr = _ptr;
return ptr[0] | (ptr[1] << 8) | (ptr[2] << 16) | (ptr[3] << 24);
}

static inline void put_unaligned_le16(__u16 val, void *_ptr)
{
__u8 *ptr = _ptr;
*ptr++ = val;
*ptr++ = val >> 8;
}

static inline void put_unaligned_le32(__u32 val, void *_ptr)
{
__u8 *ptr = _ptr;
*ptr++ = val;
*ptr++ = val >> 8;
*ptr++ = val >> 16;
*ptr++ = val >> 24;
}


/******************** Messages and Errors ***********************************/

Expand Down

0 comments on commit d12bdaa

Please sign in to comment.