[coreboot] r3521 - trunk/payloads/libpayload/include/arch

svn at coreboot.org svn at coreboot.org
Tue Aug 19 19:46:03 CEST 2008


Author: stepan
Date: 2008-08-19 19:46:02 +0200 (Tue, 19 Aug 2008)
New Revision: 3521

Modified:
   trunk/payloads/libpayload/include/arch/endian.h
Log:
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 <patrick.georgi at coresystems.de>
Acked-by: Jordan Crouse <jordan.crouse at amd.com>
Acked-by: Stefan Reinauer <stepan at coresystems.de>



Modified: trunk/payloads/libpayload/include/arch/endian.h
===================================================================
--- trunk/payloads/libpayload/include/arch/endian.h	2008-08-19 17:44:49 UTC (rev 3520)
+++ trunk/payloads/libpayload/include/arch/endian.h	2008-08-19 17:46:02 UTC (rev 3521)
@@ -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 <arch/types.h>
 
-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





More information about the coreboot mailing list