summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2015-04-20 12:37:20 -0600
committerSimon Glass <sjg@chromium.org>2015-05-05 20:58:20 -0600
commitbe47aa65225113355d1dbbc870d480d95638a3d5 (patch)
tree44b698474b13581c3a044fe026ff0b330d04e1a6 /include
parent714209832db1064886680b138f1abf9ce235b2c3 (diff)
downloadblackbird-obmc-uboot-be47aa65225113355d1dbbc870d480d95638a3d5.tar.gz
blackbird-obmc-uboot-be47aa65225113355d1dbbc870d480d95638a3d5.zip
dm: Remove unnecessary types in bcd.h
We don't need to use u8, and if we avoid it, it isn't so much of a problem that rtc.h includes this header. With this change we can include rtc.h from sandbox files. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include')
-rw-r--r--include/bcd.h8
1 files changed, 3 insertions, 5 deletions
diff --git a/include/bcd.h b/include/bcd.h
index af4aa9c7ba..9ecd328284 100644
--- a/include/bcd.h
+++ b/include/bcd.h
@@ -10,14 +10,12 @@
#ifndef _BCD_H
#define _BCD_H
-#include <linux/types.h>
-
-static inline unsigned int bcd2bin(u8 val)
+static inline unsigned int bcd2bin(unsigned int val)
{
- return ((val) & 0x0f) + ((val) >> 4) * 10;
+ return ((val) & 0x0f) + ((val & 0xff) >> 4) * 10;
}
-static inline u8 bin2bcd (unsigned int val)
+static inline unsigned int bin2bcd(unsigned int val)
{
return (((val / 10) << 4) | (val % 10));
}
OpenPOWER on IntegriCloud