summaryrefslogtreecommitdiffstats
path: root/sys/mips
diff options
context:
space:
mode:
authorgonzo <gonzo@FreeBSD.org>2009-01-14 22:32:43 +0000
committergonzo <gonzo@FreeBSD.org>2009-01-14 22:32:43 +0000
commit1b3a99ae5795e2b848c1cb81e453c87d23ffd21d (patch)
tree5fa7b734f99ce7e2dc6fde39890b895b395034d0 /sys/mips
parent4a006b061c3fb5f98b9f82f683bab968f6c32282 (diff)
downloadFreeBSD-src-1b3a99ae5795e2b848c1cb81e453c87d23ffd21d.zip
FreeBSD-src-1b3a99ae5795e2b848c1cb81e453c87d23ffd21d.tar.gz
o Simplify code: trade 15 lines of case for one multiplication
Diffstat (limited to 'sys/mips')
-rw-r--r--sys/mips/malta/gt_pci.c16
1 files changed, 1 insertions, 15 deletions
diff --git a/sys/mips/malta/gt_pci.c b/sys/mips/malta/gt_pci.c
index 2bb8958..e8f7ffd 100644
--- a/sys/mips/malta/gt_pci.c
+++ b/sys/mips/malta/gt_pci.c
@@ -457,21 +457,7 @@ gt_pci_write_config(device_t dev, int bus, int slot, int func, int reg,
* 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)
{
OpenPOWER on IntegriCloud