[PATCH 01/10] arm: socfpga: iossm: remove uninitialized variable
Michael Tretter
m.tretter at pengutronix.de
Tue Apr 7 10:09:55 PDT 2026
The variable i is not initialized. As the index when writing values to
cmd_resp_data is hard-coded, we may use a hard coded index in the print
statements, too.
Signed-off-by: Michael Tretter <m.tretter at pengutronix.de>
---
arch/arm/mach-socfpga/iossm_mailbox.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/arch/arm/mach-socfpga/iossm_mailbox.c b/arch/arm/mach-socfpga/iossm_mailbox.c
index 0e8c9e36017d..d89117da4fd4 100644
--- a/arch/arm/mach-socfpga/iossm_mailbox.c
+++ b/arch/arm/mach-socfpga/iossm_mailbox.c
@@ -82,7 +82,6 @@ int io96b_mb_req(phys_addr_t io96b_csr_addr, u32 ip_type, u32 instance_id,
u32 cmd_param_4, u32 cmd_param_5, u32 cmd_param_6,
struct io96b_mb_resp *resp)
{
- int i;
int ret;
u32 cmd_req, cmd_resp;
@@ -138,15 +137,15 @@ int io96b_mb_req(phys_addr_t io96b_csr_addr, u32 ip_type, u32 instance_id,
resp->cmd_resp_data[0] = readl(io96b_csr_addr + IOSSM_CMD_RESPONSE_DATA_0_OFFSET);
pr_debug("%s: IOSSM_CMD_RESPONSE_DATA_0_OFFSET 0x%llx: 0x%x\n",
__func__, io96b_csr_addr + IOSSM_CMD_RESPONSE_DATA_0_OFFSET,
- resp->cmd_resp_data[i]);
+ resp->cmd_resp_data[0]);
resp->cmd_resp_data[1] = readl(io96b_csr_addr + IOSSM_CMD_RESPONSE_DATA_1_OFFSET);
pr_debug("%s: IOSSM_CMD_RESPONSE_DATA_1_OFFSET 0x%llx: 0x%x\n",
__func__, io96b_csr_addr + IOSSM_CMD_RESPONSE_DATA_1_OFFSET,
- resp->cmd_resp_data[i]);
+ resp->cmd_resp_data[1]);
resp->cmd_resp_data[2] = readl(io96b_csr_addr + IOSSM_CMD_RESPONSE_DATA_2_OFFSET);
pr_debug("%s: IOSSM_CMD_RESPONSE_DATA_2_OFFSET 0x%llx: 0x%x\n",
__func__, io96b_csr_addr + IOSSM_CMD_RESPONSE_DATA_2_OFFSET,
- resp->cmd_resp_data[i]);
+ resp->cmd_resp_data[2]);
resp->cmd_resp_status = readl(io96b_csr_addr + IOSSM_CMD_RESPONSE_STATUS_OFFSET);
pr_debug("%s: CMD_RESPONSE_STATUS 0x%llx: 0x%x\n", __func__,
--
2.47.3
More information about the barebox
mailing list