jtag: jtag_vpi: Add missing 'default' to switch statement 40/5340/2
authorAlexandru Gagniuc <mr.nuke.me@gmail.com>
Wed, 30 Oct 2019 03:14:46 +0000 (22:14 -0500)
committerTomas Vanek <vanekt@fbl.cz>
Thu, 7 Nov 2019 08:21:02 +0000 (08:21 +0000)
If a new JTAG command is added, then GCC will complain that
enumeration value not handled in switch. Make this consistent with
other drivers, and add a 'default' case.

Change-Id: I66d6d0db3fcae93ea246f2d4882ffff5dec14693
Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Reviewed-on: http://openocd.zylin.com/5340
Tested-by: jenkins
Reviewed-by: Jan Matyas <matyas@codasip.com>
Reviewed-by: Franck Jullien <franck.jullien@gmail.com>
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
src/jtag/drivers/jtag_vpi.c

index 1033ced..3e39420 100644 (file)
@@ -384,6 +384,11 @@ static int jtag_vpi_execute_queue(void)
                case JTAG_SCAN:
                        retval = jtag_vpi_scan(cmd->cmd.scan);
                        break;
+               default:
+                       LOG_ERROR("BUG: unknown JTAG command type 0x%X",
+                                 cmd->type);
+                       retval = ERROR_FAIL;
+                       break;
                }
        }