global: Refactor get_option usage

Restructure get_option() calls to avoid unnecessary return value checks
by pre-assigning defaults to the options being retrieved.

Change-Id: I9159afe149a8eeed0785d1efd6eee8420b88b8f4
Signed-off-by: Varad Gautam <varadgautam@gmail.com>
Reviewed-on: http://review.coreboot.org/8631
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-by: Marc Jones <marc.jones@se-eng.com>
This commit is contained in:
Varad Gautam
2015-03-11 09:54:41 +05:30
committed by Marc Jones
parent 015f0aea5d
commit 06ef046045
9 changed files with 38 additions and 42 deletions

View File

@@ -179,8 +179,8 @@ static void i82801gx_power_options(device_t dev)
*
* If the option is not existent (Laptops), use MAINBOARD_POWER_ON.
*/
if (get_option(&pwr_on, "power_on_after_fail") != CB_SUCCESS)
pwr_on = MAINBOARD_POWER_ON;
pwr_on = MAINBOARD_POWER_ON;
get_option(&pwr_on, "power_on_after_fail");
reg8 = pci_read_config8(dev, GEN_PMCON_3);
reg8 &= 0xfe;