spi: put brackets such that GCC12 considers it a pointer for sure

otherwise you get the warning/error px4_spi_buses can never be NULL
This commit is contained in:
Matthias Grob 2023-03-20 22:29:37 +01:00 committed by Daniel Agar
parent 0c97b0f4b0
commit adb22f1407
1 changed files with 1 additions and 1 deletions

View File

@ -71,7 +71,7 @@ const px4_spi_bus_t *px4_spi_buses{nullptr};
int px4_find_spi_bus(uint32_t devid)
{
for (int i = 0; (px4_spi_bus_t *) px4_spi_buses != nullptr && i < SPI_BUS_MAX_BUS_ITEMS; ++i) {
for (int i = 0; ((px4_spi_bus_t *) px4_spi_buses) != nullptr && i < SPI_BUS_MAX_BUS_ITEMS; ++i) {
const px4_spi_bus_t &bus_data = px4_spi_buses[i];
if (bus_data.bus == -1) {