Back to home page

LXR

 
 

    


0001 #include <linux/bcd.h>
0002 #include <linux/export.h>
0003 
0004 unsigned _bcd2bin(unsigned char val)
0005 {
0006     return (val & 0x0f) + (val >> 4) * 10;
0007 }
0008 EXPORT_SYMBOL(_bcd2bin);
0009 
0010 unsigned char _bin2bcd(unsigned val)
0011 {
0012     return ((val / 10) << 4) + val % 10;
0013 }
0014 EXPORT_SYMBOL(_bin2bcd);