Merge branch 'x86-build-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull x86/build changes from Ingo Molnar.

* 'x86-build-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86, build: Fix portability issues when cross-building
  x86, tools: Remove unneeded header files from tools/build.c
  USB: ffs-test: Don't duplicate {get,put}_unaligned*() functions
  x86, efi: Fix endian issues and unaligned accesses
  x86, boot: Restrict CFLAGS for hostprogs
  x86, mkpiggy: Don't open code put_unaligned_le32()
  x86, relocs: Don't open code put_unaligned_le32()
  tools/include: Add byteshift headers for endian access
This commit is contained in:
Linus Torvalds
2012-03-22 09:40:53 -07:00
melakukan 02c502566e
9 mengubah file dengan 169 tambahan dan 65 penghapusan

Melihat File

@@ -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

Melihat File

@@ -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"
@@ -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 ***********************************/