From bc1c98a8c79b6f72395123ea8ed857a488746d4b Mon Sep 17 00:00:00 2001 From: Yann Gautier Date: Mon, 14 Feb 2022 09:58:11 +0100 Subject: [PATCH] fix(st-sdmmc2): correct cmd_idx type in messages As cmd_idx is unsigned, we have to use %u and not %d. This avoids warning when -Wformat-signedness is enabled. Change-Id: I6954a8c939f3fb47dbb2c6db56a1909565af078b Signed-off-by: Yann Gautier --- drivers/st/mmc/stm32_sdmmc2.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/st/mmc/stm32_sdmmc2.c b/drivers/st/mmc/stm32_sdmmc2.c index dbdaa545d..3f709a763 100644 --- a/drivers/st/mmc/stm32_sdmmc2.c +++ b/drivers/st/mmc/stm32_sdmmc2.c @@ -319,7 +319,7 @@ static int stm32_sdmmc2_send_cmd_req(struct mmc_cmd *cmd) while ((status & flags_cmd) == 0U) { if (timeout_elapsed(timeout)) { err = -ETIMEDOUT; - ERROR("%s: timeout 10ms (cmd = %d,status = %x)\n", + ERROR("%s: timeout 10ms (cmd = %u,status = %x)\n", __func__, cmd->cmd_idx, status); goto err_exit; } @@ -339,12 +339,12 @@ static int stm32_sdmmc2_send_cmd_req(struct mmc_cmd *cmd) (cmd->cmd_idx == MMC_CMD(13)) || ((cmd->cmd_idx == MMC_CMD(8)) && (cmd->resp_type == MMC_RESPONSE_R7)))) { - ERROR("%s: CTIMEOUT (cmd = %d,status = %x)\n", + ERROR("%s: CTIMEOUT (cmd = %u,status = %x)\n", __func__, cmd->cmd_idx, status); } } else { err = -EIO; - ERROR("%s: CRCFAIL (cmd = %d,status = %x)\n", + ERROR("%s: CRCFAIL (cmd = %u,status = %x)\n", __func__, cmd->cmd_idx, status); } @@ -385,7 +385,7 @@ static int stm32_sdmmc2_send_cmd_req(struct mmc_cmd *cmd) while ((status & flags_data) == 0U) { if (timeout_elapsed(timeout)) { - ERROR("%s: timeout 10ms (cmd = %d,status = %x)\n", + ERROR("%s: timeout 10ms (cmd = %u,status = %x)\n", __func__, cmd->cmd_idx, status); err = -ETIMEDOUT; goto err_exit; @@ -397,7 +397,7 @@ static int stm32_sdmmc2_send_cmd_req(struct mmc_cmd *cmd) if ((status & (SDMMC_STAR_DTIMEOUT | SDMMC_STAR_DCRCFAIL | SDMMC_STAR_TXUNDERR | SDMMC_STAR_RXOVERR | SDMMC_STAR_IDMATE)) != 0U) { - ERROR("%s: Error flag (cmd = %d,status = %x)\n", __func__, + ERROR("%s: Error flag (cmd = %u,status = %x)\n", __func__, cmd->cmd_idx, status); err = -EIO; } -- 2.39.5