summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaveh Jalali <caveh@chromium.org>2023-01-12 18:18:24 -0800
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2023-01-18 07:18:18 +0000
commit6ad090f115c2efed55408660a024cc86cbe4c0dc (patch)
treeb18d7727b1912657c635ac0159a384b052fd34a9
parent2f780954e0f4068fd23e89e20c539736ca4dd2c4 (diff)
downloadchrome-ec-6ad090f115c2efed55408660a024cc86cbe4c0dc.tar.gz
zephyr/test: host_event_commands: Fix EVENT_CLEAR tests
The EC_CMD_HOST_EVENT_CLEAR* host commands do not return data. Remove code for handling nonexistent return data. Next, make host_event_mask_cmd_helper() static since it's not used outside this file and signature has changed. BRANCH=none BUG=b:258110734 TEST='./twister -v -T zephyr/test' passes Change-Id: Id101dc5c52110eca581da544e78cf9f0605f6698 Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4171498 Reviewed-by: Boris Mittelberg <bmbm@google.com> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
-rw-r--r--zephyr/test/drivers/host_cmd/src/host_event_commands.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/zephyr/test/drivers/host_cmd/src/host_event_commands.c b/zephyr/test/drivers/host_cmd/src/host_event_commands.c
index 8e7fff0fe2..537610443a 100644
--- a/zephyr/test/drivers/host_cmd/src/host_event_commands.c
+++ b/zephyr/test/drivers/host_cmd/src/host_event_commands.c
@@ -161,8 +161,8 @@ ZTEST_USER(host_cmd_host_event_commands, test_host_event_clear_cmd)
}
}
-enum ec_status host_event_mask_cmd_helper(uint32_t command, uint32_t mask,
- struct ec_response_host_event_mask *r)
+static enum ec_status host_event_mask_cmd_helper(uint32_t command,
+ uint32_t mask)
{
enum ec_status ret_val;
@@ -170,7 +170,7 @@ enum ec_status host_event_mask_cmd_helper(uint32_t command, uint32_t mask,
.mask = mask,
};
struct host_cmd_handler_args args =
- BUILD_HOST_COMMAND(command, 0, *r, params);
+ BUILD_HOST_COMMAND_PARAMS(command, 0, params);
ret_val = host_command_process(&args);
@@ -186,7 +186,6 @@ ZTEST_USER(host_cmd_host_event_commands, test_host_event_clear__cmd)
host_event_t events;
host_event_t mask = EC_HOST_EVENT_MASK(EC_HOST_EVENT_KEYBOARD_RECOVERY);
host_event_t lpc_event_mask;
- struct ec_response_host_event_mask response = { 0 };
lpc_event_mask = lpc_get_host_event_mask(LPC_HOST_EVENT_SMI);
lpc_set_host_event_mask(LPC_HOST_EVENT_SMI, lpc_event_mask | mask);
@@ -196,8 +195,7 @@ ZTEST_USER(host_cmd_host_event_commands, test_host_event_clear__cmd)
zassert_true(events & mask, "events=0x%X", events);
- ret_val = host_event_mask_cmd_helper(EC_CMD_HOST_EVENT_CLEAR, mask,
- &response);
+ ret_val = host_event_mask_cmd_helper(EC_CMD_HOST_EVENT_CLEAR, mask);
zassert_equal(ret_val, EC_RES_SUCCESS, "Expected %d, returned %d",
EC_RES_SUCCESS, ret_val);
@@ -215,7 +213,6 @@ ZTEST_USER(host_cmd_host_event_commands, test_host_event_clear_b_cmd)
host_event_t events_b;
host_event_t mask = EC_HOST_EVENT_MASK(EC_HOST_EVENT_KEYBOARD_RECOVERY);
host_event_t lpc_event_mask;
- struct ec_response_host_event_mask response = { 0 };
struct ec_response_host_event result = { 0 };
lpc_event_mask = lpc_get_host_event_mask(LPC_HOST_EVENT_SMI);
@@ -227,8 +224,7 @@ ZTEST_USER(host_cmd_host_event_commands, test_host_event_clear_b_cmd)
events_b = result.value;
zassert_true(events_b & mask, "events_b=0x%X", events_b);
- ret_val = host_event_mask_cmd_helper(EC_CMD_HOST_EVENT_CLEAR_B, mask,
- &response);
+ ret_val = host_event_mask_cmd_helper(EC_CMD_HOST_EVENT_CLEAR_B, mask);
zassert_equal(ret_val, EC_RES_SUCCESS, "Expected %d, returned %d",
EC_RES_SUCCESS, ret_val);