From b8cfd063683cec565aa137ca4b754182eacb72e9 Mon Sep 17 00:00:00 2001 From: Mark O'Donovan Date: Tue, 24 Feb 2026 20:49:50 +0000 Subject: [PATCH] target/semihosting_common: remove redundant NULL check The value semihosting can never be NULL here. Found by cppcheck. Change-Id: Iff5cef0ffc78ec19bc7630bc2cc9bc4eea002e47 Signed-off-by: Mark O'Donovan Reviewed-on: https://review.openocd.org/c/openocd/+/9503 Tested-by: jenkins Reviewed-by: Antonio Borneo --- src/target/semihosting_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/target/semihosting_common.c b/src/target/semihosting_common.c index 345e542c3..bcf37b6ad 100644 --- a/src/target/semihosting_common.c +++ b/src/target/semihosting_common.c @@ -1857,7 +1857,7 @@ COMMAND_HANDLER(handle_common_semihosting_command) return ERROR_FAIL; } - if (semihosting && semihosting->setup(target, is_active) != ERROR_OK) { + if (semihosting->setup(target, is_active) != ERROR_OK) { LOG_ERROR("Failed to Configure semihosting"); return ERROR_FAIL; }