From 66006d83b99843ab7c6ec19125e2fc20855a4c7c Mon Sep 17 00:00:00 2001 From: Antonio Borneo Date: Mon, 16 Sep 2024 11:37:05 +0200 Subject: [PATCH] target: drop comparison to NULL Fix checkpatch error: ERROR:COMPARISON_TO_NULL: Comparison to NULL could be written "cmd_ctx" Change-Id: I3615fc427f8b160d44b6edbf7a066a086cab99bb Signed-off-by: Antonio Borneo Reviewed-on: https://review.openocd.org/c/openocd/+/8495 Tested-by: jenkins Reviewed-by: zapb --- src/target/target.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/target/target.c b/src/target/target.c index 56aa8b1e7..2be8b24b9 100644 --- a/src/target/target.c +++ b/src/target/target.c @@ -4596,7 +4596,7 @@ static int target_jim_write_memory(Jim_Interp *interp, int argc, } struct command_context *cmd_ctx = current_command_context(interp); - assert(cmd_ctx != NULL); + assert(cmd_ctx); struct target *target = get_current_target(cmd_ctx); const size_t buffersize = 4096; @@ -4739,7 +4739,7 @@ static int target_jim_get_reg(Jim_Interp *interp, int argc, return JIM_ERR; struct command_context *cmd_ctx = current_command_context(interp); - assert(cmd_ctx != NULL); + assert(cmd_ctx); const struct target *target = get_current_target(cmd_ctx); for (int i = 0; i < length; i++) {