diff options
author | Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> | 2009-06-05 11:41:51 +0000 |
---|---|---|
committer | Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> | 2009-06-05 11:41:51 +0000 |
commit | 87e7050bff564820e3337c0653211a8180ef1fc0 (patch) | |
tree | 530f5a9db56d7579fbb3a61806adc709305982e0 /src | |
parent | 28d71b9445ef2774baa5e1f5ad17160d90b0e8bb (diff) | |
download | coreboot-staging-87e7050bff564820e3337c0653211a8180ef1fc0.zip coreboot-staging-87e7050bff564820e3337c0653211a8180ef1fc0.tar.gz |
die() does never return. Annotate it as such.
Any endless loop after die() can be eliminated.
Dereferencing a NULL pointer is bad. die() instead.
Replace endless loops with die().
Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Peter Stuge <peter@stuge.se>
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@4340 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'src')
-rw-r--r-- | src/console/console.c | 2 | ||||
-rw-r--r-- | src/devices/pci_ops.c | 5 | ||||
-rw-r--r-- | src/devices/smbus_ops.c | 1 | ||||
-rw-r--r-- | src/southbridge/intel/i82801dbm/i82801dbm_lpc.c | 4 |
4 files changed, 5 insertions, 7 deletions
diff --git a/src/console/console.c b/src/console/console.c index aeccc14..af790de 100644 --- a/src/console/console.c +++ b/src/console/console.c @@ -92,7 +92,7 @@ void post_code(uint8_t value) } /* Report a fatal error */ -void die(const char *msg) +void __attribute__((noreturn)) die(const char *msg) { printk_emerg("%s", msg); post_code(0xff); diff --git a/src/devices/pci_ops.c b/src/devices/pci_ops.c index 08792f2..ed984f8 100644 --- a/src/devices/pci_ops.c +++ b/src/devices/pci_ops.c @@ -30,7 +30,7 @@ static struct bus *get_pbus(device_t dev) struct bus *pbus; if (!dev) - printk_alert("get_pbus: dev is NULL!\n"); + die("get_pbus: dev is NULL!\n"); pbus = dev->bus; @@ -44,9 +44,8 @@ static struct bus *get_pbus(device_t dev) pbus = pbus->dev->bus; } if (!pbus || !pbus->dev || !pbus->dev->ops || !pbus->dev->ops->ops_pci_bus) { - printk_alert("%s Cannot find pci bus operations", dev_path(dev)); + printk_emerg("%s Cannot find pci bus operations\n", dev_path(dev)); die(""); - for(;;); } return pbus; } diff --git a/src/devices/smbus_ops.c b/src/devices/smbus_ops.c index c66dbe6..acf0b1f 100644 --- a/src/devices/smbus_ops.c +++ b/src/devices/smbus_ops.c @@ -34,7 +34,6 @@ struct bus *get_pbus_smbus(device_t dev) if (!pbus || !pbus->dev || !pbus->dev->ops || !pbus->dev->ops->ops_smbus_bus) { printk_alert("%s Cannot find smbus bus operations", dev_path(dev)); die(""); - for(;;); } return pbus; } diff --git a/src/southbridge/intel/i82801dbm/i82801dbm_lpc.c b/src/southbridge/intel/i82801dbm/i82801dbm_lpc.c index cec0919..51debe7 100644 --- a/src/southbridge/intel/i82801dbm/i82801dbm_lpc.c +++ b/src/southbridge/intel/i82801dbm/i82801dbm_lpc.c @@ -37,12 +37,12 @@ void i82801dbm_enable_ioapic( struct device *dev) dword=*ioapic_sbd; printk_debug("Southbridge apic id = %x\n",dword); if(dword!=(2<<24)) - for(;;); + die(""); //lyh *ioapic_sba=3; //lyh dword=*ioapic_sbd; //lyh printk_debug("Southbridge apic DT = %x\n",dword); //lyh if(dword!=1) - //lyh for(;;); + //lyh die(""); } |