From 06ef04604570d402687245521731053c66888b15 Mon Sep 17 00:00:00 2001 From: Varad Gautam Date: Wed, 11 Mar 2015 09:54:41 +0530 Subject: 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 Reviewed-on: http://review.coreboot.org/8631 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi Reviewed-by: Marc Jones --- src/southbridge/intel/i82801dx/lpc.c | 4 ++-- src/southbridge/intel/i82801gx/lpc.c | 4 ++-- src/southbridge/intel/i82801ix/lpc.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src/southbridge/intel') diff --git a/src/southbridge/intel/i82801dx/lpc.c b/src/southbridge/intel/i82801dx/lpc.c index 83d617897e..2f3db86b24 100644 --- a/src/southbridge/intel/i82801dx/lpc.c +++ b/src/southbridge/intel/i82801dx/lpc.c @@ -116,8 +116,8 @@ static void i82801dx_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; diff --git a/src/southbridge/intel/i82801gx/lpc.c b/src/southbridge/intel/i82801gx/lpc.c index cbc010605b..b8edfe3fd9 100644 --- a/src/southbridge/intel/i82801gx/lpc.c +++ b/src/southbridge/intel/i82801gx/lpc.c @@ -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; diff --git a/src/southbridge/intel/i82801ix/lpc.c b/src/southbridge/intel/i82801ix/lpc.c index 0ba33d6759..4f576c4e3d 100644 --- a/src/southbridge/intel/i82801ix/lpc.c +++ b/src/southbridge/intel/i82801ix/lpc.c @@ -186,8 +186,8 @@ static void i82801ix_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, D31F0_GEN_PMCON_3); reg8 &= 0xfe; -- cgit v1.2.3