]> git.sur5r.net Git - u-boot/commitdiff
Reverse the meaning of the fit_config_verify() return code
authorSimon Glass <sjg@chromium.org>
Thu, 12 Jun 2014 13:24:45 +0000 (07:24 -0600)
committerTom Rini <trini@ti.com>
Thu, 19 Jun 2014 15:18:58 +0000 (11:18 -0400)
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>
common/cmd_fdt.c
common/image-fit.c
common/image-sig.c
tools/fit_check_sign.c

index 6831af4dedc5b76196be1722f227bc16352c2224..e86d992838ee2986f57e9466271b4d393a7e05a0 100644 (file)
@@ -612,7 +612,7 @@ static int do_fdt(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
                }
 
                ret = fit_config_verify(working_fdt, cfg_noffset);
-               if (ret == 1)
+               if (ret == 0)
                        return CMD_RET_SUCCESS;
                else
                        return CMD_RET_FAILURE;
index 732505a36c165436b0751890378d3d76e6b479e9..40c7e27c6e6da81495165601f5d7d0a57266e5aa 100644 (file)
@@ -1534,7 +1534,7 @@ int fit_image_load(bootm_headers_t *images, const char *prop_name, ulong addr,
                        images->fit_uname_cfg = fit_uname_config;
                        if (IMAGE_ENABLE_VERIFY && images->verify) {
                                puts("   Verifying Hash Integrity ... ");
-                               if (!fit_config_verify(fit, cfg_noffset)) {
+                               if (fit_config_verify(fit, cfg_noffset)) {
                                        puts("Bad Data Hash\n");
                                        bootstage_error(bootstage_id +
                                                BOOTSTAGE_SUB_HASH);
index 72284eb1d1fd00947863c63b55b1a3f3ece6f8c0..48788f9100023bc4a41ce345c8d04cfbde45e816 100644 (file)
@@ -467,6 +467,6 @@ int fit_config_verify_required_sigs(const void *fit, int conf_noffset,
 
 int fit_config_verify(const void *fit, int conf_noffset)
 {
-       return !fit_config_verify_required_sigs(fit, conf_noffset,
-                                               gd_fdt_blob());
+       return fit_config_verify_required_sigs(fit, conf_noffset,
+                                              gd_fdt_blob());
 }
index e1198bca4498983593b31b9afd16b35c7713c202..768be2f484a90dbd302efa4f6dfd42f08af38e63 100644 (file)
@@ -80,8 +80,7 @@ int main(int argc, char **argv)
 
        image_set_host_blob(key_blob);
        ret = fit_check_sign(fit_blob, key_blob);
-
-       if (ret)
+       if (!ret)
                ret = EXIT_SUCCESS;
        else
                ret = EXIT_FAILURE;