From adb22f1407cc2e31d9271ad415478924b009f8cb Mon Sep 17 00:00:00 2001 From: Matthias Grob Date: Mon, 20 Mar 2023 22:29:37 +0100 Subject: [PATCH] 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 --- platforms/common/spi.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platforms/common/spi.cpp b/platforms/common/spi.cpp index 62713b0798..adda7b4b57 100644 --- a/platforms/common/spi.cpp +++ b/platforms/common/spi.cpp @@ -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) {