Commit 79bffb1e authored by Parshuram Thombare's avatar Parshuram Thombare Committed by Mark Brown

spi: cadence: fix static checker warning

This patch fixes Smatch static checker warning.
CDNS_XSPI_CMD_REG_5 is used in ACMD mode and currently
only STIG mode is enabled which doesn't use CDNS_XSPI_CMD_REG_5
and hence everything was working in STIG mode.
Since plan is to use same function cdns_xspi_trigger_command()
in ACMD mode, increasing size of the array passed to it.

Fixes: a16cc807 ("spi: cadence: add support for Cadence XSPI controller")
Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/linux-spi/20210930134231.GA14363@kili/Signed-off-by: default avatarParshuram Thombare <pthombar@cadence.com>
Link: https://lore.kernel.org/r/1633336704-22735-1-git-send-email-pthombar@cadence.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent acde4081
...@@ -239,7 +239,7 @@ static int cdns_xspi_wait_for_controller_idle(struct cdns_xspi_dev *cdns_xspi) ...@@ -239,7 +239,7 @@ static int cdns_xspi_wait_for_controller_idle(struct cdns_xspi_dev *cdns_xspi)
} }
static void cdns_xspi_trigger_command(struct cdns_xspi_dev *cdns_xspi, static void cdns_xspi_trigger_command(struct cdns_xspi_dev *cdns_xspi,
u32 cmd_regs[5]) u32 cmd_regs[6])
{ {
writel(cmd_regs[5], cdns_xspi->iobase + CDNS_XSPI_CMD_REG_5); writel(cmd_regs[5], cdns_xspi->iobase + CDNS_XSPI_CMD_REG_5);
writel(cmd_regs[4], cdns_xspi->iobase + CDNS_XSPI_CMD_REG_4); writel(cmd_regs[4], cdns_xspi->iobase + CDNS_XSPI_CMD_REG_4);
...@@ -346,7 +346,7 @@ static int cdns_xspi_send_stig_command(struct cdns_xspi_dev *cdns_xspi, ...@@ -346,7 +346,7 @@ static int cdns_xspi_send_stig_command(struct cdns_xspi_dev *cdns_xspi,
const struct spi_mem_op *op, const struct spi_mem_op *op,
bool data_phase) bool data_phase)
{ {
u32 cmd_regs[5]; u32 cmd_regs[6];
u32 cmd_status; u32 cmd_status;
int ret; int ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment