cpu/stm32f0: spi: Cast enum to unsigned int for comparison
This commit is contained in:
parent
698b2841d1
commit
81feb558ef
@ -162,7 +162,7 @@ int spi_conf_pins(spi_t dev)
|
|||||||
|
|
||||||
int spi_acquire(spi_t dev)
|
int spi_acquire(spi_t dev)
|
||||||
{
|
{
|
||||||
if (dev >= SPI_NUMOF) {
|
if ((unsigned int)dev >= SPI_NUMOF) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
mutex_lock(&locks[dev]);
|
mutex_lock(&locks[dev]);
|
||||||
@ -171,7 +171,7 @@ int spi_acquire(spi_t dev)
|
|||||||
|
|
||||||
int spi_release(spi_t dev)
|
int spi_release(spi_t dev)
|
||||||
{
|
{
|
||||||
if (dev >= SPI_NUMOF) {
|
if ((unsigned int)dev >= SPI_NUMOF) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
mutex_unlock(&locks[dev]);
|
mutex_unlock(&locks[dev]);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user