spi: aspeed: Fix __iomem annotation and VLA parameter

Chin-Ting Kuo <chin-ting_kuo@aspeedtech.com> says:

This series fixes two sparse warnings reported by the kernel test robot.
The first patch fixes missing __iomem annotation on an MMIO pointer
parameter, which also caused a redundant cast at the call site.
A VLA function parameter warning is also fixed in this patch series.

Link: https://patch.msgid.link/20260522071621.102507-1-chin-ting_kuo@aspeedtech.com
This commit is contained in:
Mark Brown 2026-05-22 11:55:30 +01:00
commit ae14c160f4
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0

View File

@ -891,7 +891,7 @@ static int aspeed_spi_user_unprepare_msg(struct spi_controller *ctlr,
static void aspeed_spi_user_transfer_tx(struct aspeed_spi *aspi,
struct spi_device *spi,
const u8 *tx_buf, u8 *rx_buf,
void *dst, u32 len)
void __iomem *dst, u32 len)
{
const struct aspeed_spi_data *data = aspi->data;
bool full_duplex_transfer = data->full_duplex && tx_buf == rx_buf;
@ -936,7 +936,7 @@ static int aspeed_spi_user_transfer(struct spi_controller *ctlr,
aspeed_spi_set_io_mode(chip, CTRL_IO_QUAD_DATA);
aspeed_spi_user_transfer_tx(aspi, spi, tx_buf, rx_buf,
(void *)ahb_base, xfer->len);
ahb_base, xfer->len);
}
if (rx_buf && rx_buf != tx_buf) {
@ -1467,8 +1467,7 @@ static int aspeed_spi_do_calibration(struct aspeed_spi_chip *chip)
* must contains the highest number of consecutive "pass"
* results and not span across multiple rows.
*/
static u32 aspeed_spi_ast2600_optimized_timing(u32 rows, u32 cols,
u8 buf[rows][cols])
static u32 aspeed_spi_ast2600_optimized_timing(u32 rows, u32 cols, u8 *buf)
{
int r = 0, c = 0;
int max = 0;
@ -1478,7 +1477,7 @@ static u32 aspeed_spi_ast2600_optimized_timing(u32 rows, u32 cols,
for (j = 0; j < cols;) {
int k = j;
while (k < cols && buf[i][k])
while (k < cols && buf[(i * cols) + k])
k++;
if (k - j > max) {
@ -1541,7 +1540,7 @@ static int aspeed_spi_ast2600_calibrate(struct aspeed_spi_chip *chip, u32 hdiv,
}
}
calib_point = aspeed_spi_ast2600_optimized_timing(6, 17, calib_res);
calib_point = aspeed_spi_ast2600_optimized_timing(6, 17, &calib_res[0][0]);
/* No good setting for this frequency */
if (calib_point == 0)
return -1;