summaryrefslogtreecommitdiff
path: root/common/i2c_controller.c
diff options
context:
space:
mode:
authorCaveh Jalali <caveh@chromium.org>2022-08-30 00:03:12 -0700
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-09-01 22:41:45 +0000
commit2e864b253903b8fbcfa509113be2407e76daea2e (patch)
treee383593749ba7d726dcdb45e30c2098a47bb4a05 /common/i2c_controller.c
parent76789c78aff4a73c2dc0aca526267714fffb075b (diff)
downloadchrome-ec-2e864b253903b8fbcfa509113be2407e76daea2e.tar.gz
tree-wide: const-ify argv for console commands
This updates the API for console commands from "int cmd(int argc, char **argv)" to "int cmd(int argc, const char **argv)" which is more accurate and in line with common convention. BRANCH=none BUG=b:244387210 TEST="make buildall" passes TEST="zmake build -a" passes TEST="util/compare_build.sh -b all" passes TEST="./twister -v -T zephyr/test" passes Cq-Depend: chrome-internal:4960125 Cq-Depend: chrome-internal:4959932 Change-Id: I57de9f35b85b8f3c7119df36aefb2abf25d2625f Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3863941 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Tom Hughes <tomhughes@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org>
Diffstat (limited to 'common/i2c_controller.c')
-rw-r--r--common/i2c_controller.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/common/i2c_controller.c b/common/i2c_controller.c
index ee72caa1ef..6b7f218fda 100644
--- a/common/i2c_controller.c
+++ b/common/i2c_controller.c
@@ -1521,7 +1521,7 @@ DECLARE_HOST_COMMAND(EC_CMD_I2C_CONTROL, i2c_command_control, EC_VER_MASK(0));
/* Console commands */
#ifdef CONFIG_CMD_I2C_PROTECT
-static int command_i2cprotect(int argc, char **argv)
+static int command_i2cprotect(int argc, const char **argv)
{
if (argc == 1) {
int i, port;
@@ -1597,7 +1597,7 @@ scan_bus_exit:
ccputs("\n");
}
-static int command_scan(int argc, char **argv)
+static int command_scan(int argc, const char **argv)
{
int port;
char *e;
@@ -1632,7 +1632,7 @@ DECLARE_CONSOLE_COMMAND(i2cscan, command_scan, "i2cscan [port]",
#endif
#ifdef CONFIG_CMD_I2C_XFER
-static int command_i2cxfer(int argc, char **argv)
+static int command_i2cxfer(int argc, const char **argv)
{
int port;
uint16_t addr_flags;
@@ -1801,7 +1801,7 @@ static const char *const i2c_freq_str[] = {
BUILD_ASSERT(ARRAY_SIZE(i2c_freq_str) == I2C_FREQ_COUNT + 1);
-static int command_i2c_speed(int argc, char **argv)
+static int command_i2c_speed(int argc, const char **argv)
{
int port;
char *e;
@@ -1880,7 +1880,7 @@ static void i2c_test_status(struct i2c_test_results *i2c_test, int test_dev)
}
#define I2C_STRESS_TEST_DATA_VERIFY_RETRY_COUNT 3
-static int command_i2ctest(int argc, char **argv)
+static int command_i2ctest(int argc, const char **argv)
{
char *e;
int i, j, rv;