vc/google/chromeos/elog.c: Clean up code
Constify local variables and drop redundant logic, while preserving the original behavior. While we are at it, also reflow print statements. Change-Id: Id024f3ac717dad98c4287add9b33defde7a0028d Signed-off-by: Angel Pons <th3fanbus@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/42514 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-by: Furquan Shaikh <furquan@google.com>
This commit is contained in:
parent
eb3ae1a202
commit
12b0f7746e
|
@ -8,32 +8,21 @@
|
||||||
|
|
||||||
static void elog_add_boot_reason(void *unused)
|
static void elog_add_boot_reason(void *unused)
|
||||||
{
|
{
|
||||||
int rec = vboot_recovery_mode_enabled();
|
const int rec = vboot_recovery_mode_enabled();
|
||||||
int dev = vboot_developer_mode_enabled();
|
const int dev = vboot_developer_mode_enabled();
|
||||||
|
|
||||||
if (!rec && !dev)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (rec) {
|
if (rec) {
|
||||||
u8 reason = vboot_check_recovery_request();
|
const u8 reason = vboot_check_recovery_request();
|
||||||
elog_add_event_byte(ELOG_TYPE_CROS_RECOVERY_MODE, reason);
|
elog_add_event_byte(ELOG_TYPE_CROS_RECOVERY_MODE, reason);
|
||||||
printk(BIOS_DEBUG, "%s: Logged recovery mode boot%s, "
|
printk(BIOS_DEBUG, "%s: Logged recovery mode boot%s, reason: 0x%02x\n",
|
||||||
"reason: 0x%02x\n", __func__,
|
__func__, dev ? " (Dev-switch on)" : "", reason);
|
||||||
dev ? " (Dev-switch on)" : "", reason);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dev) {
|
/* Skip logging developer mode in ACPI resume path */
|
||||||
int log_event = 1;
|
if (dev && !acpi_is_wakeup()) {
|
||||||
|
|
||||||
/* Skip logging developer mode in ACPI resume path */
|
elog_add_event(ELOG_TYPE_CROS_DEVELOPER_MODE);
|
||||||
if (acpi_is_wakeup())
|
printk(BIOS_DEBUG, "%s: Logged dev mode boot\n", __func__);
|
||||||
log_event = 0;
|
|
||||||
|
|
||||||
if (log_event) {
|
|
||||||
elog_add_event(ELOG_TYPE_CROS_DEVELOPER_MODE);
|
|
||||||
printk(BIOS_DEBUG, "%s: Logged dev mode boot\n",
|
|
||||||
__func__);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue