Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
bcd.h File Reference
#include <linux/compiler.h>

Go to the source code of this file.

Macros

#define bcd2bin(x)
 
#define bin2bcd(x)
 
#define const_bcd2bin(x)   (((x) & 0x0f) + ((x) >> 4) * 10)
 
#define const_bin2bcd(x)   ((((x) / 10) << 4) + (x) % 10)
 

Functions

unsigned _bcd2bin (unsigned char val) __attribute_const__
 
unsigned char _bin2bcd (unsigned val) __attribute_const__
 

Macro Definition Documentation

#define bcd2bin (   x)
Value:
(__builtin_constant_p((u8 )(x)) ? \
const_bcd2bin(x) : \

Definition at line 6 of file bcd.h.

#define bin2bcd (   x)
Value:
(__builtin_constant_p((u8 )(x)) ? \
const_bin2bcd(x) : \

Definition at line 11 of file bcd.h.

#define const_bcd2bin (   x)    (((x) & 0x0f) + ((x) >> 4) * 10)

Definition at line 16 of file bcd.h.

#define const_bin2bcd (   x)    ((((x) / 10) << 4) + (x) % 10)

Definition at line 17 of file bcd.h.

Function Documentation

unsigned _bcd2bin ( unsigned char  val) const

Definition at line 4 of file bcd.c.

unsigned char _bin2bcd ( unsigned  val) const

Definition at line 10 of file bcd.c.