]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - include/bcd.h
ARM: keystone2: Cleanup PLL init code
[karo-tx-uboot.git] / include / bcd.h
index af4aa9c7baf8ace2f80e0a0ecb043d40d8b3f144..9ecd328284e9de20a293a96dff9bc655c6d529ea 100644 (file)
 #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));
 }