From dfb3c130d5cdd3a01531c23c3d15e7a1010bf221 Mon Sep 17 00:00:00 2001 From: Uwe Hermann Date: Tue, 19 Jun 2007 22:47:11 +0000 Subject: Various minor cosmetics and coding style fixes (trivial). Signed-off-by: Uwe Hermann Acked-by: Uwe Hermann git-svn-id: svn://svn.coreboot.org/coreboot/trunk@2727 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1 --- src/southbridge/intel/i82801xx/i82801xx.c | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) (limited to 'src/southbridge/intel/i82801xx/i82801xx.c') diff --git a/src/southbridge/intel/i82801xx/i82801xx.c b/src/southbridge/intel/i82801xx/i82801xx.c index 5cceab9b9b..c2ff949734 100644 --- a/src/southbridge/intel/i82801xx/i82801xx.c +++ b/src/southbridge/intel/i82801xx/i82801xx.c @@ -2,7 +2,7 @@ * This file is part of the LinuxBIOS project. * * Copyright (C) 2005 Digital Design Corporation - * (Written by Steven J. Magnani for Digital Design Corp) + * (Written by Steven J. Magnani for Digital Design) * Copyright (C) 2007 Corey Osgood * * This program is free software; you can redistribute it and/or modify @@ -30,31 +30,30 @@ void i82801xx_enable(device_t dev) unsigned int index = 0; uint16_t cur_disable_mask, new_disable_mask; - // All 82801 devices should be on bus 0 - unsigned int devfn = PCI_DEVFN(0x1f, 0); // lpc - device_t lpc_dev = dev_find_slot(0, devfn); // 0 + /* All 82801 devices should be on bus 0. */ + unsigned int devfn = PCI_DEVFN(0x1f, 0); // LPC + device_t lpc_dev = dev_find_slot(0, devfn); // 0 if (!lpc_dev) return; - /* We're going to assume, perhaps incorrectly, that if a function exists - it can be disabled. Workarounds for ICH variants that don't follow this - should be done by checking the device ID */ - + /* We're going to assume, perhaps incorrectly, that if a function + * exists it can be disabled. Workarounds for ICH variants that don't + * follow this should be done by checking the device ID. + */ if (PCI_SLOT(dev->path.u.pci.devfn) == 31) { index = PCI_FUNC(dev->path.u.pci.devfn); } else if (PCI_SLOT(dev->path.u.pci.devfn) == 29) { index = 8 + PCI_FUNC(dev->path.u.pci.devfn); } - - /* Function 0 is a bit of an exception */ - if(index == 0) - { + + /* Function 0 is a bit of an exception. */ + if (index == 0) { index = 14; } cur_disable_mask = pci_read_config16(lpc_dev, FUNC_DIS); - new_disable_mask = cur_disable_mask & ~(1 << index); // enable it + new_disable_mask = cur_disable_mask & ~(1 << index); // enable it if (!dev->enabled) { - new_disable_mask |= (1 << index); // disable it, if desired + new_disable_mask |= (1 << index); // disable it, if desired } if (new_disable_mask != cur_disable_mask) { pci_write_config16(lpc_dev, FUNC_DIS, new_disable_mask); -- cgit v1.2.3