diff mbox series

[02/10] mtd: rawnand: qcom: Rename variables in qcom_op_cmd_mapping()

Message ID 20230805174146.57006-3-manivannan.sadhasivam@linaro.org
State Accepted
Commit d68b7e5f49b81944656eeb70fae1b733f5ac26d8
Headers show
Series mtd: rawnand: qcom: Bunch of fixes and cleanups | expand

Commit Message

Manivannan Sadhasivam Aug. 5, 2023, 5:41 p.m. UTC
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@bootlin.com>
Closes: https://lore.kernel.org/all/20230804190750.3367a044@xps-13/
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
---
 drivers/mtd/nand/raw/qcom_nandc.c | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

Comments

Miquel Raynal Aug. 18, 2023, 2:41 p.m. UTC | #1
On Sat, 2023-08-05 at 17:41:38 UTC, Manivannan Sadhasivam wrote:
> 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@bootlin.com>
> Closes: https://lore.kernel.org/all/20230804190750.3367a044@xps-13/
> Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next, thanks.

Miquel
diff mbox series

Patch

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 */