• Andrew Morton's avatar
    [PATCH] BIN_TO_BCD consolidation · db8f4c7e
    Andrew Morton authored
    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.
    db8f4c7e
bcd.h 548 Bytes