drivers/flash/stm32/Xspi: Fix llvm compilation error

Fix compilation error on variable used for size of array in
OSPI and QSPI drivers.

Fixes #61804

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
This commit is contained in:
Dominik Ermel 2023-08-23 16:11:49 +00:00 committed by Carles Cufí
commit d647a85fb5
2 changed files with 6 additions and 4 deletions

View file

@ -2203,13 +2203,14 @@ static int flash_stm32_ospi_init(const struct device *dev)
if (id == JESD216_SFDP_PARAM_ID_BFP) {
union {
uint32_t dw[MIN(php->len_dw, 20)];
uint32_t dw[20];
struct jesd216_bfp bfp;
} u2;
const struct jesd216_bfp *bfp = &u2.bfp;
ret = ospi_read_sfdp(dev, jesd216_param_addr(php),
(uint8_t *)u2.dw, sizeof(u2.dw));
(uint8_t *)u2.dw,
MIN(sizeof(uint32_t) * php->len_dw, sizeof(u2.dw)));
if (ret == 0) {
ret = spi_nor_process_bfp(dev, php, bfp);
}

View file

@ -1309,13 +1309,14 @@ static int flash_stm32_qspi_init(const struct device *dev)
if (id == JESD216_SFDP_PARAM_ID_BFP) {
union {
uint32_t dw[MIN(php->len_dw, 20)];
uint32_t dw[20];
struct jesd216_bfp bfp;
} u2;
const struct jesd216_bfp *bfp = &u2.bfp;
ret = qspi_read_sfdp(dev, jesd216_param_addr(php),
(uint8_t *)u2.dw, sizeof(u2.dw));
(uint8_t *)u2.dw,
MIN(sizeof(uint32_t) * php->len_dw, sizeof(u2.dw)));
if (ret == 0) {
ret = spi_nor_process_bfp(dev, php, bfp);
}