Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030341Ab2B1T2B (ORCPT ); Tue, 28 Feb 2012 14:28:01 -0500 Received: from terminus.zytor.com ([198.137.202.10]:55032 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030279Ab2B1T16 (ORCPT ); Tue, 28 Feb 2012 14:27:58 -0500 Date: Tue, 28 Feb 2012 11:27:02 -0800 From: tip-bot for Matt Fleming Message-ID: Cc: linux-kernel@vger.kernel.org, gregkh@linuxfoundation.org, hpa@zytor.com, mingo@redhat.com, dave@gnu.org, tglx@linutronix.de, matt.fleming@intel.com Reply-To: mingo@redhat.com, hpa@zytor.com, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, tglx@linutronix.de, dave@gnu.org, matt.fleming@intel.com In-Reply-To: <1330436245-24875-7-git-send-email-matt@console-pimps.org> References: <1330436245-24875-7-git-send-email-matt@console-pimps.org> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/build] USB: ffs-test: Don't duplicate {get, put}_unaligned*() functions Git-Commit-ID: 24fa9a9d6d70ef7ef7087dce472a8f43a9078da5 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.6 (terminus.zytor.com [127.0.0.1]); Tue, 28 Feb 2012 11:27:40 -0800 (PST) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2562 Lines: 87 Commit-ID: 24fa9a9d6d70ef7ef7087dce472a8f43a9078da5 Gitweb: http://git.kernel.org/tip/24fa9a9d6d70ef7ef7087dce472a8f43a9078da5 Author: Matt Fleming AuthorDate: Tue, 28 Feb 2012 13:37:25 +0000 Committer: H. Peter Anvin CommitDate: Tue, 28 Feb 2012 10:23:18 -0800 USB: ffs-test: Don't duplicate {get,put}_unaligned*() functions Use the header file in tools/include instead of duplicating the endian functions. Cc: Davidlohr Bueso Acked-by: Greg Kroah-Hartman Signed-off-by: Matt Fleming Link: http://lkml.kernel.org/r/1330436245-24875-7-git-send-email-matt@console-pimps.org Signed-off-by: H. Peter Anvin --- tools/usb/Makefile | 2 +- tools/usb/ffs-test.c | 29 +---------------------------- 2 files changed, 2 insertions(+), 29 deletions(-) diff --git a/tools/usb/Makefile b/tools/usb/Makefile index 8b704af..396d6c4 100644 --- a/tools/usb/Makefile +++ b/tools/usb/Makefile @@ -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 diff --git a/tools/usb/ffs-test.c b/tools/usb/ffs-test.c index b9c7986..384f47a 100644 --- a/tools/usb/ffs-test.c +++ b/tools/usb/ffs-test.c @@ -36,6 +36,7 @@ #include #include #include +#include #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 ***********************************/ -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/