drivers/pinctrl/bcm: Simplify bool comparison
Subsystems (3)
PATCH 1/1 drivers/pinctrl/bcm: Simplify bool comparison
Fix the follow coccicheck warnings:
./drivers/pinctrl/bcm/pinctrl-ns2-mux.c:856:29-38: WARNING:
Comparison to bool.
--- drivers/pinctrl/bcm/pinctrl-ns2-mux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pinctrl/bcm/pinctrl-ns2-mux.c +1 -1
@@ -853,7 +853,7 @@ static int ns2_pin_config_get(struct pinctrl_dev *pctldev, unsigned int pin,switch (param) {case PIN_CONFIG_BIAS_DISABLE :ns2_pin_get_pull (pctldev, pin, &pull_up, &pull_down); -if ((pull_up == false) && (pull_down == false)) +if (!pull_up && !pull_down)return 0 ;else return -EINVAL ;
Signature · 1 line
1.8.3.1
Quoted 5 lines · Jiapeng Zhong
Fix the follow coccicheck warnings:
./drivers/pinctrl/bcm/pinctrl-ns2-mux.c:856:29-38: WARNING:
Comparison to bool.
Sorry I must be missing something here. Why is there a warning while 'pull_up' and 'pull_down' are already of type 'bool' and compared to 'false'?
Quoted 11 lines
Reported-by Abaci Robot <[email protected]>Signed-off-by Jiapeng Zhong <[email protected]>--- drivers/pinctrl/bcm/pinctrl-ns2-mux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/pinctrl/bcm/pinctrl-ns2-mux.c +0
-0
drivers/pinctrl/bcm/pinctrl-ns2-mux.c static int ns2_pin_config_get(struct pinctrl_dev *pctldev, unsigned int pin, · line 856
Quoted 5 lines
drivers/pinctrl/bcm/pinctrl-ns2-mux.c +1
-1@@ -853,7 +853,7 @@ static int ns2_pin_config_get(struct pinctrl_dev *pctldev, unsigned int pin,switch (param) {case PIN_CONFIG_BIAS_DISABLE :ns2_pin_get_pull (pctldev, pin, &pull_up, &pull_down); -if ((pull_up == false) && (pull_down == false)) +if (!pull_up && !pull_down)
Looks fine as improvement, but I'm curious why there's a warning to start with.
Thanks,
Ray
Quoted 4 lines
drivers/pinctrl/bcm/pinctrl-ns2-mux.c +0
-0return 0 ; else return -EINVAL;
Quoted 5 lines · Ray Jui
drivers/pinctrl/bcm/pinctrl-ns2-mux.c static int ns2_pin_config_get(struct pinctrl_dev *pctldev, unsigned int pin, · line 856
Quoted 2 lines
drivers/pinctrl/bcm/pinctrl-ns2-mux.c +1
-1-if ((pull_up == false) && (pull_down == false)) +if (!pull_up && !pull_down)Looks fine as improvement, but I'm curious why there's a warning to start with.
There is no semantic difference. This is a purely syntactic warning.
Yours,
Linus Walleij
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Quoted 7 lines · Jiapeng Zhong
Fix the follow coccicheck warnings:
./drivers/pinctrl/bcm/pinctrl-ns2-mux.c:856:29-38: WARNING:
Comparison to bool.Reported-by Abaci Robot <[email protected]>Signed-off-by Jiapeng Zhong <[email protected]>
Patch applied.
Yours,
Linus Walleij
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel