spi_handlers: fix some build issues

Needed string.h for memset, and the spi bufs are const.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This commit is contained in:
Andrew Boie 2018-05-17 12:05:24 -07:00 committed by Anas Nashif
commit 375e8d73ce

View file

@ -6,6 +6,7 @@
#include <spi.h> #include <spi.h>
#include <syscall_handler.h> #include <syscall_handler.h>
#include <string.h>
/* This assumes that bufs and buf_copy are copies from the values passed /* This assumes that bufs and buf_copy are copies from the values passed
* as syscall arguments. * as syscall arguments.
@ -24,7 +25,7 @@ static void copy_and_check(struct spi_buf_set *bufs,
/* Validate the array of struct spi_buf instances */ /* Validate the array of struct spi_buf instances */
Z_OOPS(Z_SYSCALL_MEMORY_ARRAY_READ(bufs->buffers, Z_OOPS(Z_SYSCALL_MEMORY_ARRAY_READ(bufs->buffers,
bufs->count, bufs->count,
sizeof(struct spi_buf)));; sizeof(struct spi_buf)));
/* Not worried abuot overflow here: _SYSCALL_MEMORY_ARRAY_READ() /* Not worried abuot overflow here: _SYSCALL_MEMORY_ARRAY_READ()
* takes care of it. * takes care of it.
@ -37,7 +38,7 @@ static void copy_and_check(struct spi_buf_set *bufs,
/* Now for each array element, validate the memory buffers /* Now for each array element, validate the memory buffers
* that they point to * that they point to
*/ */
struct spi_buf *buf = &bufs->buffers[i]; const struct spi_buf *buf = &bufs->buffers[i];
Z_OOPS(Z_SYSCALL_MEMORY(buf->buf, buf->len, writable)); Z_OOPS(Z_SYSCALL_MEMORY(buf->buf, buf->len, writable));
} }