pinctrl: imx: remove an unnecessary NULL check
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.
Signed-off-by Dan Carpenter <[email protected]>
--- drivers/pinctrl/freescale/pinctrl-imx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pinctrl/freescale/pinctrl-imx.c +1 -1
@@ -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
Quoted 7 lines
From: Dan Carpenter [mailto:[email protected]]
Sent: Thursday, March 28, 2019 10:40 PMThe 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.
Signed-off-by Dan Carpenter <[email protected]>
Acked-by Dong Aisheng <[email protected]>
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@@ -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
Quoted 4 lines · Dan Carpenter
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.
Signed-off-by Dan Carpenter <[email protected]>
Patch applied with Dong's ACK!
Yours,
Linus Walleij