From 0e4671e30575ac0f12c482d128a146d85dd27987 Mon Sep 17 00:00:00 2001 From: Patrick Georgi Date: Tue, 19 Aug 2008 17:46:02 +0000 Subject: replace static functions by macros, because otherwise every unused function would warn. Bad thing for all -Werror folks out there. Signed-off-by: Patrick Georgi Acked-by: Jordan Crouse Acked-by: Stefan Reinauer git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3521 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1 --- payloads/libpayload/include/arch/endian.h | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'payloads/libpayload/include/arch/endian.h') diff --git a/payloads/libpayload/include/arch/endian.h b/payloads/libpayload/include/arch/endian.h index 995681494a..a50ac1fede 100644 --- a/payloads/libpayload/include/arch/endian.h +++ b/payloads/libpayload/include/arch/endian.h @@ -30,17 +30,12 @@ #ifndef _ARCH_ENDIAN_H #define _ARCH_ENDIAN_H -static u32 ntohl(u32 in) -{ - return ((in & 0xFF) << 24) | ((in & 0xFF00) << 8) | - ((in & 0xFF0000) >> 8) | ((in & 0xFF000000) >> 24); -} +#include -static u64 ntohll(u64 in) -{ - u32 h = in >> 32; - u32 l = in & 0xFFFFFFFF; +#define ntohw(in) ((( (in) & 0xFF) << 8) | (( (in) & 0xFF00) >> 8)) - return (((u64) ntohl(l) << 32) | ((u64) ntohl(h))); -} +#define ntohl(in) ((( (in) & 0xFF) << 24) | (( (in) & 0xFF00) << 8) | \ + (( (in) & 0xFF0000) >> 8) | (( (in) & 0xFF000000) >> 24)) + +#define ntohll(in) (((u64) ntohl( (in) & 0xFFFFFFFF) << 32) | ((u64) ntohl( (in) >> 32))) #endif -- cgit v1.2.3