From 8b547b19800ab85c97103c87fedbba7512add7d6 Mon Sep 17 00:00:00 2001 From: Stefan Reinauer Date: Tue, 30 Mar 2010 09:56:35 +0000 Subject: reduce warnings in MCP55 and Fam10 code Signed-off-by: Stefan Reinauer Acked-by: Stefan Reinauer git-svn-id: svn://svn.coreboot.org/coreboot/trunk@5325 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1 --- src/northbridge/amd/amdht/h3ncmn.c | 32 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 18 deletions(-) (limited to 'src/northbridge/amd/amdht/h3ncmn.c') diff --git a/src/northbridge/amd/amdht/h3ncmn.c b/src/northbridge/amd/amdht/h3ncmn.c index 5b038a3a58..f4696b6daf 100644 --- a/src/northbridge/amd/amdht/h3ncmn.c +++ b/src/northbridge/amd/amdht/h3ncmn.c @@ -1109,16 +1109,14 @@ void ht1SetCFGAddrMap(u8 cfgMapIndex, u8 secBus, u8 subBus, u8 targetNode, u8 ta */ u8 convertBitsToWidth(u8 value, cNorthBridge *nb) { - if (value == 1) { - return 16; - } else if (value == 0) { - return 8; - } else if (value == 5) { - return 4; - } else if (value == 4) { - return 2; + switch(value) { + case 1: return 16; + case 0: return 8; + case 5: return 4; + case 4: return 2; + default: STOP_HERE; /* This is an error internal condition */ } - STOP_HERE; /* This is an error internal condition */ + return 0; // shut up GCC. } /**---------------------------------------------------------------------------------------- @@ -1138,16 +1136,14 @@ u8 convertBitsToWidth(u8 value, cNorthBridge *nb) */ u8 convertWidthToBits(u8 value, cNorthBridge *nb) { - if (value == 16) { - return 1; - } else if (value == 8) { - return 0; - } else if (value == 4) { - return 5; - } else if (value == 2) { - return 4; + switch (value) { + case 16: return 1; + case 8: return 0; + case 4: return 5; + case 2: return 4; + default: STOP_HERE; /* This is an internal error condition */ } - STOP_HERE; /* This is an internal error condition */ + return 0; // shut up GCC } /**---------------------------------------------------------------------------------------- -- cgit v1.2.3