diff options
| author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2008-08-08 16:21:02 -0400 |
|---|---|---|
| committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2008-08-08 16:21:02 -0400 |
| commit | e4ddcb0a6bf04d53ce77b4eb87bbbb32c4261d11 (patch) | |
| tree | d27d2fea50a384d97aa2d0cf5c8657c916f761d4 /include/linux/bcd.h | |
| parent | f2afa7711f8585ffc088ba538b9a510e0d5dca12 (diff) | |
| parent | 6e86841d05f371b5b9b86ce76c02aaee83352298 (diff) | |
Merge commit 'v2.6.27-rc1' into for-linus
Diffstat (limited to 'include/linux/bcd.h')
| -rw-r--r-- | include/linux/bcd.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/include/linux/bcd.h b/include/linux/bcd.h index c545308125b0..7ac518e3c152 100644 --- a/include/linux/bcd.h +++ b/include/linux/bcd.h | |||
| @@ -10,8 +10,13 @@ | |||
| 10 | #ifndef _BCD_H | 10 | #ifndef _BCD_H |
| 11 | #define _BCD_H | 11 | #define _BCD_H |
| 12 | 12 | ||
| 13 | #define BCD2BIN(val) (((val) & 0x0f) + ((val)>>4)*10) | 13 | #include <linux/compiler.h> |
| 14 | #define BIN2BCD(val) ((((val)/10)<<4) + (val)%10) | 14 | |
| 15 | unsigned bcd2bin(unsigned char val) __attribute_const__; | ||
| 16 | unsigned char bin2bcd(unsigned val) __attribute_const__; | ||
| 17 | |||
| 18 | #define BCD2BIN(val) bcd2bin(val) | ||
| 19 | #define BIN2BCD(val) bin2bcd(val) | ||
| 15 | 20 | ||
| 16 | /* backwards compat */ | 21 | /* backwards compat */ |
| 17 | #define BCD_TO_BIN(val) ((val)=BCD2BIN(val)) | 22 | #define BCD_TO_BIN(val) ((val)=BCD2BIN(val)) |
