]> git.neil.brown.name Git - history.git/commit
[PATCH] BIN_TO_BCD consolidation
authorAndrew Morton <akpm@digeo.com>
Mon, 30 Dec 2002 05:40:19 +0000 (21:40 -0800)
committerLinus Torvalds <torvalds@home.transmeta.com>
Mon, 30 Dec 2002 05:40:19 +0000 (21:40 -0800)
commitdb8f4c7eda8a1594c165805c1717e13af8cfb4a9
treeeb63a30af4f65c71f4f89087e2ff49e52aa99c6f
parentfe04e9451e5a159247cf9f03c615a4273ac0c571
[PATCH] BIN_TO_BCD consolidation

Cleanup patch from Hollis Blanchard <hollis@austin.ibm.com>

We have a large number of private implementations of BIN_TO_BCD and
BCD_TO_BIN, which are all the same.  And a lot of them are inflexible because
they modify their arg:

#define BIN_TO_BCD(val) ((val)=(((val)/10)<<4) + (val)%10)

- Create (in <linux/bcd.h> a generic BIN2BCD/BCD2BIN which does not modify
  its arg

- Create generic BIN_TO_BCD/BCD_TO_BIN which uses the above

- Update lots of callers to use the new generic version.
40 files changed:
arch/alpha/kernel/time.c
arch/arm/kernel/time.c
arch/cris/drivers/ds1302.c
arch/cris/kernel/time.c
arch/i386/kernel/time.c
arch/m68k/atari/time.c
arch/m68k/sun3x/time.c
arch/mips/ddb5xxx/common/rtc_ds1386.c
arch/mips/dec/time.c
arch/mips/kernel/old-time.c
arch/mips64/sgi-ip27/ip27-rtc.c
arch/mips64/sgi-ip27/ip27-timer.c
arch/ppc/iSeries/mf.c
arch/ppc/platforms/chrp_time.c
arch/ppc/platforms/gemini_setup.c
arch/ppc/platforms/prep_time.c
arch/ppc/syslib/todc_time.c
arch/ppc64/kernel/mf.c
arch/ppc64/kernel/rtc.c
arch/sh/kernel/rtc.c
arch/sparc64/kernel/time.c
arch/x86_64/kernel/time.c
drivers/acorn/char/pcf8583.c
drivers/acpi/sleep.c
drivers/char/rtc.c
drivers/scsi/sr_vendor.c
drivers/sgi/char/ds1286.c
include/asm-arm/arch-ebsa285/time.h
include/asm-cris/rtc.h
include/asm-generic/rtc.h
include/asm-mips/ds1286.h
include/asm-mips64/ds1286.h
include/asm-mips64/m48t35.h
include/asm-ppc/m48t35.h
include/asm-ppc/mk48t59.h
include/asm-ppc/nvram.h
include/asm-ppc/todc.h
include/asm-ppc64/nvram.h
include/linux/bcd.h [new file with mode: 0644]
include/linux/mc146818rtc.h