summaryrefslogtreecommitdiff
path: root/zephyr
diff options
context:
space:
mode:
authorYuval Peress <peress@google.com>2022-09-12 21:47:47 -0600
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-09-20 10:45:01 +0000
commite132da8dc36a0d726436ced9a1e86a4cc7e72da7 (patch)
tree52f0340d3768b35e89c1b7acf7445cc6d4f5b0e6 /zephyr
parentae28b6ef3a40bc065ed4df72117179bafd683cbb (diff)
downloadchrome-ec-e132da8dc36a0d726436ced9a1e86a4cc7e72da7.tar.gz
test: fix warnings
BRANCH=none BUG=none TEST=twister Signed-off-by: Yuval Peress <peress@google.com> Change-Id: Ib330e1cac7fa2439ee133292f310d9289da86201 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3893084 Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
Diffstat (limited to 'zephyr')
-rw-r--r--zephyr/fake/include/system_fake.h5
-rw-r--r--zephyr/shim/src/rtc.c1
-rw-r--r--zephyr/test/drivers/default/src/bmi160.c2
-rw-r--r--zephyr/test/drivers/default/src/console_cmd/rw.c21
-rw-r--r--zephyr/test/drivers/keyboard_scan/src/mkbp_event.c2
-rw-r--r--zephyr/test/vboot_efs2/src/main.c1
6 files changed, 24 insertions, 8 deletions
diff --git a/zephyr/fake/include/system_fake.h b/zephyr/fake/include/system_fake.h
index 42fcc5d596..b80624e289 100644
--- a/zephyr/fake/include/system_fake.h
+++ b/zephyr/fake/include/system_fake.h
@@ -15,4 +15,9 @@
*/
void system_set_shrspi_image_copy(enum ec_image new_image_copy);
+/**
+ * @brief Set the fake environment
+ */
+void system_fake_setenv(jmp_buf *env);
+
#endif /* ZEPHYR_FAKE_SYSTEM_FAKE_H */
diff --git a/zephyr/shim/src/rtc.c b/zephyr/shim/src/rtc.c
index 17cc486caa..c8a0511c95 100644
--- a/zephyr/shim/src/rtc.c
+++ b/zephyr/shim/src/rtc.c
@@ -10,6 +10,7 @@
#include "drivers/cros_rtc.h"
#include "hooks.h"
#include "host_command.h"
+#include "system.h"
#include "util.h"
LOG_MODULE_REGISTER(shim_cros_rtc, LOG_LEVEL_ERR);
diff --git a/zephyr/test/drivers/default/src/bmi160.c b/zephyr/test/drivers/default/src/bmi160.c
index c90e31699b..3f06e7f0fd 100644
--- a/zephyr/test/drivers/default/src/bmi160.c
+++ b/zephyr/test/drivers/default/src/bmi160.c
@@ -1964,7 +1964,7 @@ ZTEST_USER(bmi160, test_bmi_set_offset_invalid_type)
{
struct motion_sensor_t ms_fake;
int ret;
- int16_t unused_offset;
+ int16_t unused_offset = 0;
int16_t temp = 0;
/* make a copy of the accel motion sensor so we modify its type */
diff --git a/zephyr/test/drivers/default/src/console_cmd/rw.c b/zephyr/test/drivers/default/src/console_cmd/rw.c
index ee7ff9f6cf..2bf59b30d5 100644
--- a/zephyr/test/drivers/default/src/console_cmd/rw.c
+++ b/zephyr/test/drivers/default/src/console_cmd/rw.c
@@ -39,13 +39,16 @@ ZTEST_USER(console_cmd_rw, test_read)
uint8_t memory[] = { 0x01, 0x02, 0x03, 0x04 };
char cmd[128] = { 0 };
- zassume_true(sprintf(cmd, "rw .b %llu", memory) != 0, NULL);
+ zassume_true(sprintf(cmd, "rw .b %" PRIuPTR, (uintptr_t)memory) != 0,
+ NULL);
zassert_ok(shell_execute_cmd(get_ec_shell(), cmd), NULL);
- zassume_true(sprintf(cmd, "rw .h %llu", memory) != 0, NULL);
+ zassume_true(sprintf(cmd, "rw .h %" PRIuPTR, (uintptr_t)memory) != 0,
+ NULL);
zassert_ok(shell_execute_cmd(get_ec_shell(), cmd), NULL);
- zassume_true(sprintf(cmd, "rw %llu", memory) != 0, NULL);
+ zassume_true(sprintf(cmd, "rw %" PRIuPTR, (uintptr_t)memory) != 0,
+ NULL);
zassert_ok(shell_execute_cmd(get_ec_shell(), cmd), NULL);
}
@@ -64,7 +67,9 @@ ZTEST_USER(console_cmd_rw, test_write)
uint8_t memory[4] = { 0 };
char cmd[128] = { 0 };
- zassume_true(sprintf(cmd, "rw .b %llu 1", memory) != 0, NULL);
+ zassume_true(sprintf(cmd, "rw .b %" PRIuPTR " 1", (uintptr_t)memory) !=
+ 0,
+ NULL);
zassert_ok(shell_execute_cmd(get_ec_shell(), cmd), NULL);
zassert_equal(1, memory[0], "memory[0] was %u", memory[0]);
zassert_equal(0, memory[1], "memory[1] was %u", memory[1]);
@@ -72,7 +77,9 @@ ZTEST_USER(console_cmd_rw, test_write)
zassert_equal(0, memory[3], "memory[3] was %u", memory[3]);
memset(memory, 0, 4);
- zassume_true(sprintf(cmd, "rw .h %llu 258", memory) != 0, NULL);
+ zassume_true(sprintf(cmd, "rw .h %" PRIuPTR " 258",
+ (uintptr_t)memory) != 0,
+ NULL);
zassert_ok(shell_execute_cmd(get_ec_shell(), cmd), NULL);
zassert_equal(2, memory[0], "memory[0] was %u", memory[0]);
zassert_equal(1, memory[1], "memory[1] was %u", memory[1]);
@@ -80,7 +87,9 @@ ZTEST_USER(console_cmd_rw, test_write)
zassert_equal(0, memory[3], "memory[3] was %u", memory[3]);
memset(memory, 0, 4);
- zassume_true(sprintf(cmd, "rw %llu 16909060", memory) != 0, NULL);
+ zassume_true(sprintf(cmd, "rw %" PRIuPTR " 16909060",
+ (uintptr_t)memory) != 0,
+ NULL);
zassert_ok(shell_execute_cmd(get_ec_shell(), cmd), NULL);
zassert_equal(4, memory[0], "memory[0] was %u", memory[0]);
zassert_equal(3, memory[1], "memory[1] was %u", memory[1]);
diff --git a/zephyr/test/drivers/keyboard_scan/src/mkbp_event.c b/zephyr/test/drivers/keyboard_scan/src/mkbp_event.c
index 26ecafbfda..dee2ba2d1b 100644
--- a/zephyr/test/drivers/keyboard_scan/src/mkbp_event.c
+++ b/zephyr/test/drivers/keyboard_scan/src/mkbp_event.c
@@ -65,7 +65,7 @@ ZTEST(mkbp_event, host_command_get_events__get_event)
/* Add the above event to the MKBP keyboard FIFO and raise the event */
ret = mkbp_fifo_add(expected_event.event_type,
- (uint8_t *)&expected_event.data.key_matrix);
+ (const uint8_t *)&expected_event.data.key_matrix);
activate_mkbp_with_events(BIT(expected_event.event_type));
zassert_equal(EC_SUCCESS, ret, "Got %d when adding to FIFO", ret);
diff --git a/zephyr/test/vboot_efs2/src/main.c b/zephyr/test/vboot_efs2/src/main.c
index 6d4a9661bd..53c77ea32e 100644
--- a/zephyr/test/vboot_efs2/src/main.c
+++ b/zephyr/test/vboot_efs2/src/main.c
@@ -9,6 +9,7 @@
#include "emul/emul_flash.h"
#include "hooks.h"
#include "ppc/sn5s330_public.h"
+#include "system_fake.h"
#include "task.h"
#include "usb_mux.h"
#include "usbc_ppc.h"