Edward O'Callaghan has uploaded this change for review. ( https://review.coreboot.org/c/flashrom/+/74164 )
Change subject: board_enable.c: Invert branch for readability
......................................................................
board_enable.c: Invert branch for readability
Just use a early return for a base condition of the function
to aid in removing one layer of logic embedding within a branch.
Change-Id: I9bd96d4d077270697c329d7e6cac1d32ed513ed3
Signed-off-by: Edward O'Callaghan <quasisec(a)google.com>
---
M board_enable.c
1 file changed, 23 insertions(+), 10 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/64/74164/1
diff --git a/board_enable.c b/board_enable.c
index 795d0f3..121b211 100644
--- a/board_enable.c
+++ b/board_enable.c
@@ -2661,7 +2661,6 @@
bool force_boardenable)
{
const struct board_match *board = NULL;
- int ret = 0;
if (vendor && model) {
board = board_match_name(vendor, model, false);
@@ -2691,16 +2690,17 @@
if (board->max_rom_decode_parallel)
max_rom_decode.parallel = board->max_rom_decode_parallel * 1024;
- if (board->enable) {
- msg_pinfo("Enabling full flash access for board \"%s %s\"... ",
- board->vendor_name, board->board_name);
+ if (!board->enable)
+ return 0;
- ret = board->enable(cfg);
- if (ret)
- msg_pinfo("FAILED!\n");
- else
- msg_pinfo("OK.\n");
- }
+ msg_pinfo("Enabling full flash access for board \"%s %s\"... ",
+ board->vendor_name, board->board_name);
+
+ int ret = board->enable(cfg);
+ if (ret)
+ msg_pinfo("FAILED!\n");
+ else
+ msg_pinfo("OK.\n");
return ret;
}
--
To view, visit https://review.coreboot.org/c/flashrom/+/74164
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I9bd96d4d077270697c329d7e6cac1d32ed513ed3
Gerrit-Change-Number: 74164
Gerrit-PatchSet: 1
Gerrit-Owner: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-MessageType: newchange
Attention is currently required from: Thomas Heijligen, Edward O'Callaghan, Angel Pons.
Hello Sam McNally, build bot (Jenkins), Thomas Heijligen, Angel Pons,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/flashrom/+/73456
to look at the new patch set (#5).
Change subject: internal: Move laptop_ok into board_cfg
......................................................................
internal: Move laptop_ok into board_cfg
Due to how internal is structured around chipset_flash_enable()
entry we need to prepare a crafted programmer_cfg that contains
a board_enable substructure with data derived from the board_enable
subsystem. While this is certainly not perfection, it does make
clear the relationships between board_enable into chipset_flash_enable
and subsequently the overall internal programmer initialisation
in a RAII fashion at the type level over closure upon global
state that is impossible to reason about.
Also flip predicate in report_nonwl_laptop_detected() and
return early with the trivial base-case.
TEST=`$ sudo ./flashrom -p internal --flash-name`.
Change-Id: I459215253845c2af73262943ce91a36464e9eb06
Signed-off-by: Edward O'Callaghan <quasisec(a)google.com>
---
M board_enable.c
M chipset_enable.c
M flashrom.c
M include/programmer.h
M internal.c
5 files changed, 69 insertions(+), 44 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/56/73456/5
--
To view, visit https://review.coreboot.org/c/flashrom/+/73456
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I459215253845c2af73262943ce91a36464e9eb06
Gerrit-Change-Number: 73456
Gerrit-PatchSet: 5
Gerrit-Owner: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: Angel Pons <th3fanbus(a)gmail.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-Attention: Thomas Heijligen <src(a)posteo.de>
Gerrit-Attention: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Attention: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-MessageType: newpatchset
Attention is currently required from: Thomas Heijligen, Angel Pons.
Hello build bot (Jenkins), Thomas Heijligen, Angel Pons,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/flashrom/+/74071
to look at the new patch set (#3).
Change subject: data/flashchips.json: Add JSON flashchips db variant
......................................................................
data/flashchips.json: Add JSON flashchips db variant
Generated from flashchips.c at commit 73e47091.
Change-Id: I7fceac8a285c8ecf3f3a09a90cc1ae369e8a9429
Signed-off-by: Edward O'Callaghan <quasisec(a)google.com>
---
A data/flashchips.json
1 file changed, 177,912 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/71/74071/3
--
To view, visit https://review.coreboot.org/c/flashrom/+/74071
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I7fceac8a285c8ecf3f3a09a90cc1ae369e8a9429
Gerrit-Change-Number: 74071
Gerrit-PatchSet: 3
Gerrit-Owner: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: Thomas Heijligen <src(a)posteo.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Thomas Heijligen <src(a)posteo.de>
Gerrit-Attention: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-MessageType: newpatchset
Attention is currently required from: Thomas Heijligen, Angel Pons.
Edward O'Callaghan has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/74065 )
Change subject: util/flashchips_db_jsoniser: Initial version
......................................................................
Patch Set 1:
(1 comment)
File util/flashchips_db_jsoniser/main.c:
https://review.coreboot.org/c/flashrom/+/74065/comment/352ffa23_d4769747
PS1, Line 69: static char *decode_test_state(enum test_state ts)
: {
: switch (ts) {
: case OK: return "OK";
: case NT: return "NT";
: case BAD: return "BAD";
: case DEP: return "DEP";
: case NA: return "NA";
: }
: return NULL;
: };
:
: static char *decode_cmdset(int cmdset)
: {
: switch (cmdset) {
: case SPI25: return "SPI25";
: case SPI_EDI: return "SPI_EDI";
: }
: return NULL;
: }
> Ah, so this won't be needed
No. This specific code is irrelevant for anything more than showing that the array of C struct's into JSON transformation is genuine so the community can audit and modify it until we are happy with the JSON output adequately represents the original with good fidelity.
If you wish you can clang-format it locally for your own readability, but I don't want to break output formatting for no reason.
--
To view, visit https://review.coreboot.org/c/flashrom/+/74065
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I3b65caeb811ec0978091c543ccffb5a1b0d254ba
Gerrit-Change-Number: 74065
Gerrit-PatchSet: 1
Gerrit-Owner: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: Thomas Heijligen <src(a)posteo.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Sam McNally <sammc(a)google.com>
Gerrit-Attention: Thomas Heijligen <src(a)posteo.de>
Gerrit-Attention: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Comment-Date: Wed, 29 Mar 2023 10:15:34 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Edward O'Callaghan <quasisec(a)chromium.org>
Comment-In-Reply-To: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-MessageType: comment