diff options
author | Edward O'Callaghan <quasisec@google.com> | 2023-03-06 09:05:16 +1100 |
---|---|---|
committer | Edward O'Callaghan <quasisec@chromium.org> | 2023-03-28 00:44:02 +0000 |
commit | 73e47091103891f2e3c12c5c51840faf9b57e436 (patch) | |
tree | 5b2cb5d04b16247dd096266e04e8450cd7de4675 | |
parent | e7ff5f51fefa782edbe168ff339aa99e9b41c965 (diff) | |
download | flashrom-73e47091103891f2e3c12c5c51840faf9b57e436.tar.gz flashrom-73e47091103891f2e3c12c5c51840faf9b57e436.tar.bz2 flashrom-73e47091103891f2e3c12c5c51840faf9b57e436.zip |
board_enable.c: Consistent board_flash_enable() nullarity checks
Use a consistent style, as is the case in the Linux kernel, of
the canonical form of nullarity checking. Thus, making the
function have a overall consistent style.
Change-Id: Id28b8b70d9ecc9f69a1b61684500d9c6023ca045
Signed-off-by: Edward O'Callaghan <quasisec@google.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/73454
Reviewed-by: Thomas Heijligen <src@posteo.de>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
-rw-r--r-- | board_enable.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/board_enable.c b/board_enable.c index bf7897ba..abc8b095 100644 --- a/board_enable.c +++ b/board_enable.c @@ -2737,7 +2737,7 @@ int board_flash_enable(const char *vendor, const char *model, const char *cb_ven const struct board_match *board = NULL; int ret = 0; - if (vendor != NULL && model != NULL) { + if (vendor && model) { board = board_match_name(vendor, model, false); if (!board) { /* If a board was given by the user it has to match, else we abort here. */ msg_perr("No suitable board enable found for vendor=\"%s\", model=\"%s\".\n", @@ -2745,14 +2745,14 @@ int board_flash_enable(const char *vendor, const char *model, const char *cb_ven return 1; } } - if (board == NULL && cb_vendor != NULL && cb_model != NULL) { + if (!board && cb_vendor && cb_model) { board = board_match_name(cb_vendor, cb_model, true); if (!board) { /* Failure is an option here, because many cb boards don't require an enable. */ msg_pdbg2("No board enable found matching coreboot IDs vendor=\"%s\", model=\"%s\".\n", cb_vendor, cb_model); } } - if (board == NULL) { + if (!board) { board = board_match_pci_ids(P3); if (!board) /* i.e. there is just no board enable available for this board */ return 0; @@ -2765,7 +2765,7 @@ int board_flash_enable(const char *vendor, const char *model, const char *cb_ven if (board->max_rom_decode_parallel) max_rom_decode.parallel = board->max_rom_decode_parallel * 1024; - if (board->enable != NULL) { + if (board->enable) { msg_pinfo("Enabling full flash access for board \"%s %s\"... ", board->vendor_name, board->board_name); |