Kyösti Mälkki has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/34924 )
Change subject: google/stout: Use MAYBE_STATIC ......................................................................
google/stout: Use MAYBE_STATIC
Change-Id: I11027acb11a4656536384134d0caebd14b63770c Signed-off-by: Kyösti Mälkki kyosti.malkki@gmail.com --- M src/mainboard/google/stout/chromeos.c 1 file changed, 8 insertions(+), 13 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/24/34924/1
diff --git a/src/mainboard/google/stout/chromeos.c b/src/mainboard/google/stout/chromeos.c index ff247da..f186f83 100644 --- a/src/mainboard/google/stout/chromeos.c +++ b/src/mainboard/google/stout/chromeos.c @@ -71,10 +71,9 @@ */ int get_recovery_mode_switch(void) { -#ifndef __PRE_RAM__ - static int ec_in_rec_mode = 0; - static int ec_rec_flag_good = 0; -#endif + MAYBE_STATIC int ec_in_rec_mode = 0; + MAYBE_STATIC int ec_rec_flag_good = 0; + pci_devfn_t dev = PCI_DEV(0, 0x1f, 0); u8 reg8 = pci_s_read_config8(dev, GEN_PMCON_3);
@@ -83,17 +82,13 @@ printk(BIOS_SPEW,"%s: EC status:%#x RTC_BAT: %x\n", __func__, ec_status, reg8 & RTC_BATTERY_DEAD);
-#ifdef __PRE_RAM__ - return (((reg8 & RTC_BATTERY_DEAD) != 0) && - ((ec_status & 0x3) == EC_IN_RECOVERY_MODE)); -#else - if (!ec_rec_flag_good) { - ec_in_rec_mode = (((reg8 & RTC_BATTERY_DEAD) != 0) && + if (ec_rec_flag_good) + return ec_in_rec_mode; + + ec_in_rec_mode = (((reg8 & RTC_BATTERY_DEAD) != 0) && ((ec_status & 0x3) == EC_IN_RECOVERY_MODE)); - ec_rec_flag_good = 1; - } + ec_rec_flag_good = 1; return ec_in_rec_mode; -#endif }
static const struct cros_gpio cros_gpios[] = {
Furquan Shaikh has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34924 )
Change subject: google/stout: Use MAYBE_STATIC ......................................................................
Patch Set 2:
(1 comment)
https://review.coreboot.org/c/coreboot/+/34924/2/src/mainboard/google/stout/... File src/mainboard/google/stout/chromeos.c:
https://review.coreboot.org/c/coreboot/+/34924/2/src/mainboard/google/stout/... PS2, Line 85: if (ec_rec_flag_good) : return ec_in_rec_mode; Move this up before line 77?
Hello Aaron Durbin, build bot (Jenkins), Furquan Shaikh,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/34924
to look at the new patch set (#3).
Change subject: google/stout: Use MAYBE_STATIC ......................................................................
google/stout: Use MAYBE_STATIC
Change-Id: I11027acb11a4656536384134d0caebd14b63770c Signed-off-by: Kyösti Mälkki kyosti.malkki@gmail.com --- M src/mainboard/google/stout/chromeos.c 1 file changed, 9 insertions(+), 14 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/24/34924/3
Kyösti Mälkki has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34924 )
Change subject: google/stout: Use MAYBE_STATIC ......................................................................
Patch Set 3:
(1 comment)
https://review.coreboot.org/c/coreboot/+/34924/2/src/mainboard/google/stout/... File src/mainboard/google/stout/chromeos.c:
https://review.coreboot.org/c/coreboot/+/34924/2/src/mainboard/google/stout/... PS2, Line 85: if (ec_rec_flag_good) : return ec_in_rec_mode;
Move this up before line 77?
Done
Marshall Dawson has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34924 )
Change subject: google/stout: Use MAYBE_STATIC ......................................................................
Patch Set 3: Code-Review+2
Kyösti Mälkki has submitted this change and it was merged. ( https://review.coreboot.org/c/coreboot/+/34924 )
Change subject: google/stout: Use MAYBE_STATIC ......................................................................
google/stout: Use MAYBE_STATIC
Change-Id: I11027acb11a4656536384134d0caebd14b63770c Signed-off-by: Kyösti Mälkki kyosti.malkki@gmail.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/34924 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Marshall Dawson marshalldawson3rd@gmail.com --- M src/mainboard/google/stout/chromeos.c 1 file changed, 9 insertions(+), 14 deletions(-)
Approvals: build bot (Jenkins): Verified Marshall Dawson: Looks good to me, approved
diff --git a/src/mainboard/google/stout/chromeos.c b/src/mainboard/google/stout/chromeos.c index ff247da..44784b4 100644 --- a/src/mainboard/google/stout/chromeos.c +++ b/src/mainboard/google/stout/chromeos.c @@ -71,10 +71,12 @@ */ int get_recovery_mode_switch(void) { -#ifndef __PRE_RAM__ - static int ec_in_rec_mode = 0; - static int ec_rec_flag_good = 0; -#endif + MAYBE_STATIC int ec_in_rec_mode = 0; + MAYBE_STATIC int ec_rec_flag_good = 0; + + if (ec_rec_flag_good) + return ec_in_rec_mode; + pci_devfn_t dev = PCI_DEV(0, 0x1f, 0); u8 reg8 = pci_s_read_config8(dev, GEN_PMCON_3);
@@ -83,17 +85,10 @@ printk(BIOS_SPEW,"%s: EC status:%#x RTC_BAT: %x\n", __func__, ec_status, reg8 & RTC_BATTERY_DEAD);
-#ifdef __PRE_RAM__ - return (((reg8 & RTC_BATTERY_DEAD) != 0) && - ((ec_status & 0x3) == EC_IN_RECOVERY_MODE)); -#else - if (!ec_rec_flag_good) { - ec_in_rec_mode = (((reg8 & RTC_BATTERY_DEAD) != 0) && - ((ec_status & 0x3) == EC_IN_RECOVERY_MODE)); - ec_rec_flag_good = 1; - } + ec_in_rec_mode = (((reg8 & RTC_BATTERY_DEAD) != 0) && + ((ec_status & 0x3) == EC_IN_RECOVERY_MODE)); + ec_rec_flag_good = 1; return ec_in_rec_mode; -#endif }
static const struct cros_gpio cros_gpios[] = {