Edward O'Callaghan has submitted this change. ( https://review.coreboot.org/c/flashrom/+/62996 )
Change subject: dmi.c: Ensure g_has_dmi_support is default on shutdown
......................................................................
dmi.c: Ensure g_has_dmi_support is default on shutdown
Ensure the g_has_dmi_support variable has the default state
of false after the life-time has expired.
BUG=none
TEST=builds
Change-Id: I0674950304736e53d014117d287682a4f6349879
Signed-off-by: Edward O'Callaghan <quasisec(a)google.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/62996
Tested-by: build bot (Jenkins) <no-reply(a)coreboot.org>
Reviewed-by: Thomas Heijligen <src(a)posteo.de>
Reviewed-by: Nikolai Artemiev <nartemiev(a)google.com>
Reviewed-by: Angel Pons <th3fanbus(a)gmail.com>
---
M dmi.c
1 file changed, 1 insertion(+), 0 deletions(-)
Approvals:
build bot (Jenkins): Verified
Thomas Heijligen: Looks good to me, approved
Angel Pons: Looks good to me, but someone else must approve
Nikolai Artemiev: Looks good to me, but someone else must approve
diff --git a/dmi.c b/dmi.c
index a82b494..7c0fc4c 100644
--- a/dmi.c
+++ b/dmi.c
@@ -386,6 +386,7 @@
free(dmi_strings[i].value);
dmi_strings[i].value = NULL;
}
+ g_has_dmi_support = false;
return 0;
}
1 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.
--
To view, visit https://review.coreboot.org/c/flashrom/+/62996
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I0674950304736e53d014117d287682a4f6349879
Gerrit-Change-Number: 62996
Gerrit-PatchSet: 3
Gerrit-Owner: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: Nikolai Artemiev <nartemiev(a)google.com>
Gerrit-Reviewer: Thomas Heijligen <src(a)posteo.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-MessageType: merged
Attention is currently required from: Edward O'Callaghan.
Hello build bot (Jenkins), Thomas Heijligen, Angel Pons, Nikolai Artemiev,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/flashrom/+/62996
to look at the new patch set (#2).
Change subject: dmi.c: Ensure g_has_dmi_support is default on shutdown
......................................................................
dmi.c: Ensure g_has_dmi_support is default on shutdown
Ensure the g_has_dmi_support variable has the default state
of false after the life-time has expired.
BUG=none
TEST=builds
Change-Id: I0674950304736e53d014117d287682a4f6349879
Signed-off-by: Edward O'Callaghan <quasisec(a)google.com>
---
M dmi.c
1 file changed, 1 insertion(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/96/62996/2
--
To view, visit https://review.coreboot.org/c/flashrom/+/62996
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I0674950304736e53d014117d287682a4f6349879
Gerrit-Change-Number: 62996
Gerrit-PatchSet: 2
Gerrit-Owner: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: Nikolai Artemiev <nartemiev(a)google.com>
Gerrit-Reviewer: Thomas Heijligen <src(a)posteo.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-Attention: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-MessageType: newpatchset
Edward O'Callaghan has submitted this change. ( https://review.coreboot.org/c/flashrom/+/59283 )
Change subject: dmi.c: Hide has_dmi_support global behind method
......................................................................
dmi.c: Hide has_dmi_support global behind method
This allows has_dmi_support to be become static local
to just the scope of dmi.c
BUG=none
TEST=builds
Change-Id: Ibded9714998ea6f2e5d4e0512fa7c6b105f9638a
Signed-off-by: Edward O'Callaghan <quasisec(a)google.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/59283
Tested-by: build bot (Jenkins) <no-reply(a)coreboot.org>
Reviewed-by: Nikolai Artemiev <nartemiev(a)google.com>
Reviewed-by: Sam McNally <sammc(a)google.com>
Reviewed-by: Angel Pons <th3fanbus(a)gmail.com>
Reviewed-by: Thomas Heijligen <src(a)posteo.de>
---
M board_enable.c
M dmi.c
M programmer.h
3 files changed, 10 insertions(+), 5 deletions(-)
Approvals:
build bot (Jenkins): Verified
Thomas Heijligen: Looks good to me, approved
Angel Pons: Looks good to me, but someone else must approve
Sam McNally: Looks good to me, approved
Nikolai Artemiev: Looks good to me, but someone else must approve
diff --git a/board_enable.c b/board_enable.c
index 442db33..9e4ab93 100644
--- a/board_enable.c
+++ b/board_enable.c
@@ -2666,7 +2666,7 @@
#if defined(__i386__) || defined(__x86_64__)
if (board->dmi_pattern) {
- if (!has_dmi_support) {
+ if (!dmi_is_supported()) {
msg_pwarn("Warning: Can't autodetect %s %s, DMI info unavailable.\n",
board->vendor_name, board->board_name);
msg_pinfo("Please supply the board vendor and model name with the "
diff --git a/dmi.c b/dmi.c
index a7b300d..a82b494 100644
--- a/dmi.c
+++ b/dmi.c
@@ -40,7 +40,12 @@
/* Strings longer than 4096 in DMI are just insane. */
#define DMI_MAX_ANSWER_LEN 4096
-int has_dmi_support = 0;
+static bool g_has_dmi_support = false;
+
+bool dmi_is_supported(void)
+{
+ return g_has_dmi_support;
+}
static struct {
const char *const keyword;
@@ -405,7 +410,7 @@
break;
}
- has_dmi_support = 1;
+ g_has_dmi_support = true;
unsigned int i;
for (i = 0; i < ARRAY_SIZE(dmi_strings); i++) {
msg_pdbg("DMI string %s: \"%s\"\n", dmi_strings[i].keyword,
@@ -465,7 +470,7 @@
{
unsigned int i;
- if (!has_dmi_support)
+ if (!dmi_is_supported())
return 0;
for (i = 0; i < ARRAY_SIZE(dmi_strings); i++) {
diff --git a/programmer.h b/programmer.h
index 33cbcc7..0657bb1 100644
--- a/programmer.h
+++ b/programmer.h
@@ -245,8 +245,8 @@
/* dmi.c */
#if defined(__i386__) || defined(__x86_64__)
-extern int has_dmi_support;
void dmi_init(void);
+bool dmi_is_supported(void);
int dmi_match(const char *pattern);
#endif // defined(__i386__) || defined(__x86_64__)
4 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.
--
To view, visit https://review.coreboot.org/c/flashrom/+/59283
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Ibded9714998ea6f2e5d4e0512fa7c6b105f9638a
Gerrit-Change-Number: 59283
Gerrit-PatchSet: 6
Gerrit-Owner: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: Nikolai Artemiev <nartemiev(a)google.com>
Gerrit-Reviewer: Sam McNally <sammc(a)google.com>
Gerrit-Reviewer: Thomas Heijligen <src(a)posteo.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-MessageType: merged