Commit 375e8d73 authored by Andrew Boie's avatar Andrew Boie Committed by Anas Nashif
Browse files

spi_handlers: fix some build issues



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

Signed-off-by: default avatarAndrew Boie <andrew.p.boie@intel.com>
parent 3772f771
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -6,6 +6,7 @@

#include <spi.h>
#include <syscall_handler.h>
#include <string.h>

/* This assumes that bufs and buf_copy are copies from the values passed
 * 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 */
	Z_OOPS(Z_SYSCALL_MEMORY_ARRAY_READ(bufs->buffers,
					   bufs->count,
					   sizeof(struct spi_buf)));;
					   sizeof(struct spi_buf)));

	/* Not worried abuot overflow here: _SYSCALL_MEMORY_ARRAY_READ()
	 * 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
		 * 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));
	}