From e4629eb0bb2ae27daf0cca811d719fe13ab9ab7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Nohlg=C3=A5rd?= Date: Tue, 26 Jan 2016 19:56:40 +0100 Subject: [PATCH] cpu/stm32f3: spi: Cast enum to unsigned int for comparison --- cpu/stm32f3/periph/spi.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cpu/stm32f3/periph/spi.c b/cpu/stm32f3/periph/spi.c index 6a0bb22472..e8c045e16d 100644 --- a/cpu/stm32f3/periph/spi.c +++ b/cpu/stm32f3/periph/spi.c @@ -290,7 +290,7 @@ int spi_conf_pins(spi_t dev) int spi_acquire(spi_t dev) { - if (dev >= SPI_NUMOF) { + if ((unsigned int)dev >= SPI_NUMOF) { return -1; } mutex_lock(&locks[dev]); @@ -299,7 +299,7 @@ int spi_acquire(spi_t dev) int spi_release(spi_t dev) { - if (dev >= SPI_NUMOF) { + if ((unsigned int)dev >= SPI_NUMOF) { return -1; } mutex_unlock(&locks[dev]); @@ -335,7 +335,7 @@ int spi_transfer_byte(spi_t dev, char out, char *in) void spi_transmission_begin(spi_t dev, char reset_val) { - if (dev < SPI_NUMOF) { + if ((unsigned int)dev < SPI_NUMOF) { spi[dev]->DR = reset_val; } }