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/+/9011

-- gerrit

commit 5b8664f9d01137ed803cae2f92780ae79fc043f8
Author: Antonio Borneo <borneo.anto...@gmail.com>
Date:   Sat Jun 28 10:34:00 2025 +0200

    flash: nand: prepare for aligning switch and case statements
    
    To prepare for aligning switch and case statements, fix in advance
    some checkpatch error due to existing code:
    - remove useless parenthesis;
    - don't end line with an open parenthesis;
    - expand multiple assignments.
    
    While there, put the 'default' case as last in the list.
    
    Change-Id: I17bf5e88b145ef9b5b188424182f4e54b818eeae
    Signed-off-by: Antonio Borneo <borneo.anto...@gmail.com>

diff --git a/src/flash/nand/core.c b/src/flash/nand/core.c
index c5430aeb05..e5f330d2d6 100644
--- a/src/flash/nand/core.c
+++ b/src/flash/nand/core.c
@@ -314,8 +314,7 @@ int nand_probe(struct nand_device *nand)
                                LOG_DEBUG("controller initialization failed");
                                return ERROR_NAND_OPERATION_FAILED;
                        case ERROR_NAND_OPERATION_NOT_SUPPORTED:
-                               LOG_ERROR(
-                               "BUG: controller reported that it doesn't 
support default parameters");
+                               LOG_ERROR("BUG: controller reported that it 
doesn't support default parameters");
                                return ERROR_NAND_OPERATION_FAILED;
                        default:
                                LOG_ERROR("BUG: unknown controller 
initialization failure");
@@ -474,11 +473,10 @@ int nand_probe(struct nand_device *nand)
                                LOG_DEBUG("controller initialization failed");
                                return ERROR_NAND_OPERATION_FAILED;
                        case ERROR_NAND_OPERATION_NOT_SUPPORTED:
-                               LOG_ERROR(
-                               "controller doesn't support requested 
parameters (buswidth: %i, address cycles: %i, page size: %i)",
-                               nand->bus_width,
-                               nand->address_cycles,
-                               nand->page_size);
+                               LOG_ERROR("controller doesn't support requested 
parameters (buswidth: %i, address cycles: %i, page size: %i)",
+                                       nand->bus_width,
+                                       nand->address_cycles,
+                                       nand->page_size);
                                return ERROR_NAND_OPERATION_FAILED;
                        default:
                                LOG_ERROR("BUG: unknown controller 
initialization failure");
diff --git a/src/flash/nand/mx3.c b/src/flash/nand/mx3.c
index 86e94685b7..abcc44c3fc 100644
--- a/src/flash/nand/mx3.c
+++ b/src/flash/nand/mx3.c
@@ -663,7 +663,7 @@ static int do_data_output(struct nand_device *nand)
                        /*
                         * ECC stuff
                         */
-                       if ((mx3_nf_info->optype == MX3_NF_DATAOUT_PAGE)
+                       if (mx3_nf_info->optype == MX3_NF_DATAOUT_PAGE
                                        && mx3_nf_info->flags.hw_ecc_enabled) {
                                uint16_t ecc_status;
                                target_read_u16 (target, MX3_NF_ECCSTATUS, 
&ecc_status);
diff --git a/src/flash/nand/tcl.c b/src/flash/nand/tcl.c
index 67a62770fb..d40377cc0b 100644
--- a/src/flash/nand/tcl.c
+++ b/src/flash/nand/tcl.c
@@ -50,21 +50,22 @@ COMMAND_HANDLER(handle_nand_info_command)
        int last = -1;
 
        switch (CMD_ARGC) {
-               default:
-                       return ERROR_COMMAND_SYNTAX_ERROR;
                case 1:
                        first = 0;
                        last = INT32_MAX;
                        break;
                case 2:
                        COMMAND_PARSE_NUMBER(int, CMD_ARGV[1], i);
-                       first = last = i;
+                       first = i;
+                       last = i;
                        i = 0;
                        break;
                case 3:
                        COMMAND_PARSE_NUMBER(int, CMD_ARGV[1], first);
                        COMMAND_PARSE_NUMBER(int, CMD_ARGV[2], last);
                        break;
+               default:
+                       return ERROR_COMMAND_SYNTAX_ERROR;
        }
 
        struct nand_device *p;

-- 

Reply via email to