[coreboot-gerrit] Change in coreboot[master]: mb/lenovo/s230u: Fix USBDEBUG check

Martin Roth (Code Review) gerrit at coreboot.org
Sun Mar 26 04:32:08 CEST 2017


Martin Roth has submitted this change and it was merged. ( https://review.coreboot.org/18974 )

Change subject: mb/lenovo/s230u: Fix USBDEBUG check
......................................................................


mb/lenovo/s230u: Fix USBDEBUG check

- Change preprocessor #if to standard C if.  This will get optimized
out if the config option is disabled, but lets the compiler check the
contents.
- CONFIG_USBDEBUG is always going to be defined even if it's disabled,
so this check is not going to work as expected.
See the coreboot Kconfig documentation in /Documentation/core/Kconfig.md

Change-Id: Ia63438d9525e79307d9229ad3ffa2962978611d8
Signed-off-by: Martin Roth <martinroth at google.com>
Reviewed-on: https://review.coreboot.org/18974
Reviewed-by: Patrick Georgi <pgeorgi at google.com>
Reviewed-by: Philippe Mathieu-Daudé <philippe.mathieu.daude at gmail.com>
Tested-by: build bot (Jenkins)
---
M src/mainboard/lenovo/s230u/romstage.c
1 file changed, 2 insertions(+), 3 deletions(-)

Approvals:
  Philippe Mathieu-Daudé: Looks good to me, but someone else must approve
  build bot (Jenkins): Verified
  Patrick Georgi: Looks good to me, approved



diff --git a/src/mainboard/lenovo/s230u/romstage.c b/src/mainboard/lenovo/s230u/romstage.c
index ce75165..ad5f021 100644
--- a/src/mainboard/lenovo/s230u/romstage.c
+++ b/src/mainboard/lenovo/s230u/romstage.c
@@ -51,10 +51,9 @@
 		CONFIG_EC_BASE_ADDRESS | 1);
 	pci_write_config16(PCI_DEV(0, 0x1f, 0), 0xd8, 0xffc0);
 
-	#ifdef CONFIG_USBDEBUG
 	/* Enable external USB port power. */
-	ec_mm_set_bit(0x3b, 4);
-	#endif
+	if (IS_ENABLED(CONFIG_USBDEBUG))
+		ec_mm_set_bit(0x3b, 4);
 }
 
 void rcba_config(void)

-- 
To view, visit https://review.coreboot.org/18974
To unsubscribe, visit https://review.coreboot.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia63438d9525e79307d9229ad3ffa2962978611d8
Gerrit-PatchSet: 3
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Owner: Martin Roth <martinroth at google.com>
Gerrit-Reviewer: Martin Roth <martinroth at google.com>
Gerrit-Reviewer: Patrick Georgi <pgeorgi at google.com>
Gerrit-Reviewer: Philippe Mathieu-Daudé <philippe.mathieu.daude at gmail.com>
Gerrit-Reviewer: build bot (Jenkins)



More information about the coreboot-gerrit mailing list