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 <guoshichao@xiaomi.com>
This commit is contained in:
guoshichao 2024-07-31 15:43:12 +08:00 committed by Xiang Xiao
parent 1174d223d4
commit cd52edd6d7
2 changed files with 3 additions and 3 deletions

View File

@ -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);
}

View File

@ -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.