From fe415dbf62af0c2dcd67339709e36dc5f091db9c Mon Sep 17 00:00:00 2001 From: Qiu Peiyang Date: Fri, 31 Mar 2017 15:45:31 +0800 Subject: [PATCH] tests: drivers: spi: fix variable type mismatches These were flagged by icx build. Jira: ZEP-1887 Change-Id: Iaeedb13be23e86ebfb29a6441574b7384ae836e1 Signed-off-by: Qiu Peiyang --- tests/drivers/spi/spi_basic_api/src/test_spi.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/tests/drivers/spi/spi_basic_api/src/test_spi.c b/tests/drivers/spi/spi_basic_api/src/test_spi.c index e31c9834590..e087ba480b4 100644 --- a/tests/drivers/spi/spi_basic_api/src/test_spi.c +++ b/tests/drivers/spi/spi_basic_api/src/test_spi.c @@ -34,8 +34,8 @@ static struct spi_config spi_conf = { .max_sys_freq = SPI_MAX_CLK_FREQ_250KHZ, }; -static unsigned char wbuf[16] = "Hello"; -static unsigned char rbuf[16] = {}; +static char *wbuf = "Hello world"; +static char rbuf[16] = {}; static int test_spi(uint32_t mode) { @@ -61,17 +61,14 @@ static int test_spi(uint32_t mode) } /* 3. verify spi_write() */ - if (spi_write(spi_dev, (uint8_t *) wbuf, 6) != 0) { + if (spi_write(spi_dev, wbuf, len) != 0) { TC_PRINT("SPI write failed\n"); return TC_FAIL; } - strcpy((char *)wbuf, "So what then?"); - len = strlen(wbuf); - /* 4. verify spi_transceive() */ TC_PRINT("SPI sent: %s\n", wbuf); - if (spi_transceive(spi_dev, wbuf, len + 1, rbuf, len + 1) != 0) { + if (spi_transceive(spi_dev, wbuf, len, rbuf, len) != 0) { TC_PRINT("SPI transceive failed\n"); return TC_FAIL; }