rtc: BCD codeshrink
authorDavid Brownell <david-b@pacbell.net>
Thu, 24 Jul 2008 04:30:37 +0000 (21:30 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 24 Jul 2008 17:47:33 +0000 (10:47 -0700)
commitd3de851a445123f24ad8ece18662014b5e8a8b4e
tree44ef8b43208ba8a071fcd4d4b22e76c55881836d
parent53e84b672c1a8190af2b376c35c7a39cf1214f59
rtc: BCD codeshrink

This updates <linux/bcd.h> to define the key routines as constant
functions, which the macros will then call.  Newer code can now call
bcd2bin() instead of SCREAMING BCD2BIN() TO THE FOUR WINDS.

This lets each driver shrink their codespace by using N function calls to
a single (global) copy of those routines, instead of N inlined copies of
these functions per driver.

These routines aren't used in speed-critical code.  Almost all callers are
in the RTC framework.  Typical per-driver savings is near 300 bytes.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Acked-by: Adrian Bunk <bunk@kernel.org>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
include/linux/bcd.h
lib/Makefile
lib/bcd.c [new file with mode: 0644]