Author: gonzo Date: Wed Jan 14 22:32:43 2009 New Revision: 187251 URL: http://svn.freebsd.org/changeset/base/187251
Log: o Simplify code: trade 15 lines of case for one multiplication Modified: head/sys/mips/malta/gt_pci.c Modified: head/sys/mips/malta/gt_pci.c ============================================================================== --- head/sys/mips/malta/gt_pci.c Wed Jan 14 22:11:01 2009 (r187250) +++ head/sys/mips/malta/gt_pci.c Wed Jan 14 22:32:43 2009 (r187251) @@ -457,21 +457,7 @@ gt_pci_write_config(device_t dev, int bu * Should we set the mode explicitly during chip * Initialization? */ - switch(reg % 4) - { - case 3: - shift = 24; - break; - case 2: - shift = 16; - break; - case 1: - shift = 8; - break; - default: - shift = 0; - break; - } + shift = 8 * (reg & 3); switch(bytes) { _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"