drivers: spi: xmc4xxx: Fix compiler warning with debug flags enabled

Fixes warning when CONFIG_DEBUG_OPTIMIZATION=y:

zephyrproject/modules/hal/infineon/XMCLib/drivers/inc/xmc_usic.h:2132:18:
warning: 'clock_settings' may be used uninitialized [-Wmaybe-uninitialized]
 2132 |                  (uint32_t)passive_level |
      |                  ^~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
This commit is contained in:
Andriy Gelman 2023-09-28 19:04:54 -04:00 committed by Carles Cufí
parent a34d4d1ce9
commit 325e28218f

View file

@ -195,7 +195,8 @@ static int spi_xmc4xxx_configure(const struct device *dev, const struct spi_conf
bool CPOL = SPI_MODE_GET(settings) & SPI_MODE_CPOL;
bool CPHA = SPI_MODE_GET(settings) & SPI_MODE_CPHA;
XMC_SPI_CH_CONFIG_t usic_cfg = {.baudrate = spi_cfg->frequency};
XMC_SPI_CH_BRG_SHIFT_CLOCK_PASSIVE_LEVEL_t clock_settings;
XMC_SPI_CH_BRG_SHIFT_CLOCK_PASSIVE_LEVEL_t clock_settings =
XMC_SPI_CH_BRG_SHIFT_CLOCK_PASSIVE_LEVEL_0_DELAY_ENABLED;
if (spi_context_configured(ctx, spi_cfg)) {
return 0;