[PATCH 02/10] mtd: rawnand: qcom: Rename variables in qcom_op_cmd_mapping()
From: Manivannan Sadhasivam
Date: Sat Aug 05 2023 - 13:42:28 EST
qcom_op_cmd_mapping() function accepts opcode and returns the corresponding
command register. So let's rename the local variables and parameters to
reflect the same.
Reported-by: Miquel Raynal <miquel.raynal@xxxxxxxxxxx>
Closes: https://lore.kernel.org/all/20230804190750.3367a044@xps-13/
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@xxxxxxxxxx>
---
drivers/mtd/nand/raw/qcom_nandc.c | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/drivers/mtd/nand/raw/qcom_nandc.c b/drivers/mtd/nand/raw/qcom_nandc.c
index b6751fb17587..be428b80a39b 100644
--- a/drivers/mtd/nand/raw/qcom_nandc.c
+++ b/drivers/mtd/nand/raw/qcom_nandc.c
@@ -2555,39 +2555,39 @@ static int qcom_nand_attach_chip(struct nand_chip *chip)
return 0;
}
-static int qcom_op_cmd_mapping(struct qcom_nand_controller *nandc, u8 cmd,
+static int qcom_op_cmd_mapping(struct qcom_nand_controller *nandc, u8 opcode,
struct qcom_op *q_op)
{
- int ret;
+ int cmd;
- switch (cmd) {
+ switch (opcode) {
case NAND_CMD_RESET:
- ret = OP_RESET_DEVICE;
+ cmd = OP_RESET_DEVICE;
break;
case NAND_CMD_READID:
- ret = OP_FETCH_ID;
+ cmd = OP_FETCH_ID;
break;
case NAND_CMD_PARAM:
if (nandc->props->qpic_v2)
- ret = OP_PAGE_READ_ONFI_READ;
+ cmd = OP_PAGE_READ_ONFI_READ;
else
- ret = OP_PAGE_READ;
+ cmd = OP_PAGE_READ;
break;
case NAND_CMD_ERASE1:
case NAND_CMD_ERASE2:
- ret = OP_BLOCK_ERASE;
+ cmd = OP_BLOCK_ERASE;
break;
case NAND_CMD_STATUS:
- ret = OP_CHECK_STATUS;
+ cmd = OP_CHECK_STATUS;
break;
case NAND_CMD_PAGEPROG:
- ret = OP_PROGRAM_PAGE;
+ cmd = OP_PROGRAM_PAGE;
q_op->flag = OP_PROGRAM_PAGE;
nandc->exec_opwrite = true;
break;
}
- return ret;
+ return cmd;
}
/* NAND framework ->exec_op() hooks and related helpers */
--
2.25.1