From cd52edd6d702f473c5119a45da515cdfb6673978 Mon Sep 17 00:00:00 2001 From: guoshichao Date: Wed, 31 Jul 2024 15:43:12 +0800 Subject: [PATCH] greenhills: fix enumerated type mixed with another type warning "net/netdev_upperhalf.c", line 133: warning #188-D: enumerated type mixed with another type total += netdev_lower_quota_load(lower, type); CC: dirent/lib_alphasort.c "spi/spi_transfer.c", line 83: warning #188-D: enumerated type mixed with another type SPI_SETMODE(spi, seq->mode); ^ Signed-off-by: guoshichao --- drivers/net/netdev_upperhalf.c | 4 ++-- drivers/spi/spi_transfer.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/netdev_upperhalf.c b/drivers/net/netdev_upperhalf.c index 31fb1ef0729..2425d8a83a0 100644 --- a/drivers/net/netdev_upperhalf.c +++ b/drivers/net/netdev_upperhalf.c @@ -102,9 +102,9 @@ struct netdev_upperhalf_s static bool quota_is_valid(FAR struct netdev_lowerhalf_s *lower) { int total = 0; - int type; + enum netpkt_type_e type; - for (type = 0; type < NETPKT_TYPENUM; type++) + for (type = NETPKT_TX; type < NETPKT_TYPENUM; type++) { total += netdev_lower_quota_load(lower, type); } diff --git a/drivers/spi/spi_transfer.c b/drivers/spi/spi_transfer.c index 4b93d3148ca..a56b6de9ce4 100644 --- a/drivers/spi/spi_transfer.c +++ b/drivers/spi/spi_transfer.c @@ -80,7 +80,7 @@ int spi_transfer(FAR struct spi_dev_s *spi, FAR struct spi_sequence_s *seq) } #endif - SPI_SETMODE(spi, seq->mode); + SPI_SETMODE(spi, (enum spi_mode_e)seq->mode); SPI_SETBITS(spi, seq->nbits); /* Select the SPI device in preparation for the transfer.