Commit 12df2abe3e159d622701611766c085b860329f78

Authored by Simon Glass
Committed by Tom Rini
1 parent ba923cab00

Reverse the meaning of the fit_config_verify() return code

It is more common to have 0 mean OK, and -ve mean error. Change this
function to work the same way to avoid confusion.

Signed-off-by: Simon Glass <sjg@chromium.org>

Showing 4 changed files with 5 additions and 6 deletions Side-by-side Diff

... ... @@ -612,7 +612,7 @@
612 612 }
613 613  
614 614 ret = fit_config_verify(working_fdt, cfg_noffset);
615   - if (ret == 1)
  615 + if (ret == 0)
616 616 return CMD_RET_SUCCESS;
617 617 else
618 618 return CMD_RET_FAILURE;
... ... @@ -1534,7 +1534,7 @@
1534 1534 images->fit_uname_cfg = fit_uname_config;
1535 1535 if (IMAGE_ENABLE_VERIFY && images->verify) {
1536 1536 puts(" Verifying Hash Integrity ... ");
1537   - if (!fit_config_verify(fit, cfg_noffset)) {
  1537 + if (fit_config_verify(fit, cfg_noffset)) {
1538 1538 puts("Bad Data Hash\n");
1539 1539 bootstage_error(bootstage_id +
1540 1540 BOOTSTAGE_SUB_HASH);
... ... @@ -467,7 +467,7 @@
467 467  
468 468 int fit_config_verify(const void *fit, int conf_noffset)
469 469 {
470   - return !fit_config_verify_required_sigs(fit, conf_noffset,
471   - gd_fdt_blob());
  470 + return fit_config_verify_required_sigs(fit, conf_noffset,
  471 + gd_fdt_blob());
472 472 }
tools/fit_check_sign.c
... ... @@ -80,8 +80,7 @@
80 80  
81 81 image_set_host_blob(key_blob);
82 82 ret = fit_check_sign(fit_blob, key_blob);
83   -
84   - if (ret)
  83 + if (!ret)
85 84 ret = EXIT_SUCCESS;
86 85 else
87 86 ret = EXIT_FAILURE;