Skip to contentSkip to conversation

pinctrl: imx: remove an unnecessary NULL check

PATCH In review Dan Carpenter 3 participants 3 messages Mar 28, 2019 – Apr 8, 2019

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pinctrl: imx: remove an unnecessary NULL check

The address of "ipctl->pin_regs[pin_id]" can't be NULL. It's the offset into an array in the middle of a struct. This patch removes the check.

---
 drivers/pinctrl/freescale/pinctrl-imx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pinctrl/freescale/pinctrl-imx.c +1 -1
index 188001beb298..d2d4b8ffc08d 100644
@@ -449,7 +449,7 @@ static void imx_pinconf_dbg_show(struct pinctrl_dev *pctldev,
 		}
 	} else {
 		pin_reg = &ipctl->pin_regs[pin_id];
-		if (!pin_reg || pin_reg->conf_reg = -1) {
+		if (pin_reg->conf_reg = -1) {
 			seq_puts(s, "N/A");
 			return;
 		}
Signature · 1 line
2.17.1
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 7 lines

From: Dan Carpenter [mailto:[email protected]]
Sent: Thursday, March 28, 2019 10:40 PM

The address of "ipctl->pin_regs[pin_id]" can't be NULL. It's the offset into an array in the middle of a struct. This patch removes the check.

Regards
Dong Aisheng

Quoted 21 lines
---
 drivers/pinctrl/freescale/pinctrl-imx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pinctrl/freescale/pinctrl-imx.c +1 -1
index 188001beb298..d2d4b8ffc08d 100644
@@ -449,7 +449,7 @@ static void imx_pinconf_dbg_show(struct pinctrl_dev
 *pctldev,
 		}
 	} else {
 		pin_reg = &ipctl->pin_regs[pin_id];
-		if (!pin_reg || pin_reg->conf_reg == -1) {
+		if (pin_reg->conf_reg == -1) {
 			seq_puts(s, "N/A");
 			return;

}
--
2.17.1