Commit be47aa65225113355d1dbbc870d480d95638a3d5
1 parent
714209832d
Exists in
v2017.01-smarct4x
and in
34 other branches
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>
Showing 1 changed file with 3 additions and 5 deletions Side-by-side Diff
include/bcd.h
... | ... | @@ -10,14 +10,12 @@ |
10 | 10 | #ifndef _BCD_H |
11 | 11 | #define _BCD_H |
12 | 12 | |
13 | -#include <linux/types.h> | |
14 | - | |
15 | -static inline unsigned int bcd2bin(u8 val) | |
13 | +static inline unsigned int bcd2bin(unsigned int val) | |
16 | 14 | { |
17 | - return ((val) & 0x0f) + ((val) >> 4) * 10; | |
15 | + return ((val) & 0x0f) + ((val & 0xff) >> 4) * 10; | |
18 | 16 | } |
19 | 17 | |
20 | -static inline u8 bin2bcd (unsigned int val) | |
18 | +static inline unsigned int bin2bcd(unsigned int val) | |
21 | 19 | { |
22 | 20 | return (((val / 10) << 4) | (val % 10)); |
23 | 21 | } |