diff mbox

[U-Boot,09/20] dm: Remove unnecessary types in bcd.h

Message ID 1429555051-22335-10-git-send-email-sjg@chromium.org
State Accepted
Delegated to: Simon Glass
Headers show

Commit Message

Simon Glass April 20, 2015, 6:37 p.m. UTC
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>
---

 include/bcd.h | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

Comments

Simon Glass May 4, 2015, 2:20 p.m. UTC | #1
On 20 April 2015 at 12:37, Simon Glass <sjg@chromium.org> wrote:
> 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>
> ---
>
>  include/bcd.h | 8 +++-----
>  1 file changed, 3 insertions(+), 5 deletions(-)

Applied to u-boot-dm.
diff mbox

Patch

diff --git a/include/bcd.h b/include/bcd.h
index af4aa9c..9ecd328 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));
 }