summaryrefslogtreecommitdiff
path: root/payloads/libpayload/include
diff options
context:
space:
mode:
authorPhilip Prindeville <philipp@redfish-solutions.com>2011-12-23 17:09:02 -0700
committerPatrick Georgi <patrick@georgi-clan.de>2011-12-24 11:50:08 +0100
commit46404d75e4dc106268e1027a4828d8ea4f17f389 (patch)
tree1bddf458b8633134cfb67bc0506c2877562b63e7 /payloads/libpayload/include
parentd3cf0c811eccdf7b6801b0680c81d4c485a085cd (diff)
downloadcoreboot-46404d75e4dc106268e1027a4828d8ea4f17f389.tar.xz
Replace UNPACK_CB64 macro with inline
Having submitted a module based on coreboot to LKML for acceptance, it was requested that fewer macros and more inlines be used (because of their superior type-checking when performing pointer casts, etc). This is the first of several changes to make the relevant parts of coreboot comply to linux code standards. Change-Id: Iffe7061fa62fa639e0cb6ccb9125eb3403d06b1a Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com> Reviewed-on: http://review.coreboot.org/495 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
Diffstat (limited to 'payloads/libpayload/include')
-rw-r--r--payloads/libpayload/include/coreboot_tables.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/payloads/libpayload/include/coreboot_tables.h b/payloads/libpayload/include/coreboot_tables.h
index d342c992c4..3b3b7d2299 100644
--- a/payloads/libpayload/include/coreboot_tables.h
+++ b/payloads/libpayload/include/coreboot_tables.h
@@ -216,6 +216,13 @@ struct cb_cmos_checksum {
u32 type;
};
+/* Helpful inlines */
+
+static inline u64 cb_unpack64(struct cbuint64 val)
+{
+ return (((u64) val.hi) << 32) | val.lo;
+}
+
/* Helpful macros */
#define MEM_RANGE_COUNT(_rec) \
@@ -231,7 +238,4 @@ struct cb_cmos_checksum {
#define MB_PART_STRING(_mb) \
(((unsigned char *) ((_mb)->strings)) + (_mb)->part_number_idx)
-#define UNPACK_CB64(_in) \
- ( (((u64) _in.hi) << 32) | _in.lo )
-
#endif