This is an automated email from Gerrit.

"Antonio Borneo <borneo.anto...@gmail.com>" just uploaded a new patch set to 
Gerrit, which you can find at https://review.openocd.org/c/openocd/+/9043

-- gerrit

commit 075f62955811e1ce8690a07319af796274a70a50
Author: Antonio Borneo <borneo.anto...@gmail.com>
Date:   Fri Jul 25 20:09:43 2025 +0200

    svf: rework the tests in svf_xxr_common()
    
    Check the variable value against the constant.
    
    Change-Id: I353bbada2180d6df789cc225ddb15f22c7deb00d
    Signed-off-by: Antonio Borneo <borneo.anto...@gmail.com>

diff --git a/src/svf/svf.c b/src/svf/svf.c
index 7ef6df4769..6a4639ce83 100644
--- a/src/svf/svf.c
+++ b/src/svf/svf.c
@@ -1037,9 +1037,8 @@ static int svf_xxr_common(char **argus, int num_of_argu, 
char command, struct sv
                        LOG_ERROR("unknown parameter: %s", argus[i]);
                        return ERROR_FAIL;
                }
-               if (ERROR_OK !=
-               svf_copy_hexstring_to_binary(&argus[i + 1][1], pbuffer_tmp, 
i_tmp,
-                       xxr_para_tmp->len)) {
+               if (svf_copy_hexstring_to_binary(&argus[i + 1][1], pbuffer_tmp, 
i_tmp,
+                               xxr_para_tmp->len) != ERROR_OK) {
                        LOG_ERROR("fail to parse hex value");
                        return ERROR_FAIL;
                }
@@ -1050,9 +1049,8 @@ static int svf_xxr_common(char **argus, int num_of_argu, 
char command, struct sv
        /* the mask pattern used is all cares */
        if (!(xxr_para_tmp->data_mask & XXR_MASK) && i_tmp != 
xxr_para_tmp->len) {
                /* MASK not defined and length changed */
-               if (ERROR_OK !=
-               svf_adjust_array_length(&xxr_para_tmp->mask, i_tmp,
-                       xxr_para_tmp->len)) {
+               if (svf_adjust_array_length(&xxr_para_tmp->mask, i_tmp, 
xxr_para_tmp->len)
+                               != ERROR_OK) {
                        LOG_ERROR("fail to adjust length of array");
                        return ERROR_FAIL;
                }
@@ -1061,17 +1059,15 @@ static int svf_xxr_common(char **argus, int 
num_of_argu, char command, struct sv
        /* If TDO is absent, no comparison is needed, set the mask to 0 */
        if (!(xxr_para_tmp->data_mask & XXR_TDO)) {
                if (!xxr_para_tmp->tdo) {
-                       if (ERROR_OK !=
-                       svf_adjust_array_length(&xxr_para_tmp->tdo, i_tmp,
-                               xxr_para_tmp->len)) {
+                       if (svf_adjust_array_length(&xxr_para_tmp->tdo, i_tmp, 
xxr_para_tmp->len)
+                                       != ERROR_OK) {
                                LOG_ERROR("fail to adjust length of array");
                                return ERROR_FAIL;
                        }
                }
                if (!xxr_para_tmp->mask) {
-                       if (ERROR_OK !=
-                       svf_adjust_array_length(&xxr_para_tmp->mask, i_tmp,
-                               xxr_para_tmp->len)) {
+                       if (svf_adjust_array_length(&xxr_para_tmp->mask, i_tmp, 
xxr_para_tmp->len)
+                                       != ERROR_OK) {
                                LOG_ERROR("fail to adjust length of array");
                                return ERROR_FAIL;
                        }

-- 

Reply via email to