[PATCH] pinctrl: nomadik: Assign boolean values to a bool variable

Jiapeng Zhong abaci-bugfix at linux.alibaba.com
Wed Jan 20 02:43:01 EST 2021


Fix the following coccicheck warnings:

./drivers/pinctrl/nomadik/pinctrl-nomadik.c:1397:6-16: WARNING:
Assignment of 0/1 to bool variable.

./drivers/pinctrl/nomadik/pinctrl-nomadik.c:1380:4-14: WARNING:
Assignment of 0/1 to bool variable.

./drivers/pinctrl/nomadik/pinctrl-nomadik.c:1370:6-16: WARNING:
Assignment of 0/1 to bool variable.

Reported-by: Abaci Robot <abaci at linux.alibaba.com>
Signed-off-by: Jiapeng Zhong <abaci-bugfix at linux.alibaba.com>
---
 drivers/pinctrl/nomadik/pinctrl-nomadik.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/pinctrl/nomadik/pinctrl-nomadik.c b/drivers/pinctrl/nomadik/pinctrl-nomadik.c
index d4ea108..770cbf7 100644
--- a/drivers/pinctrl/nomadik/pinctrl-nomadik.c
+++ b/drivers/pinctrl/nomadik/pinctrl-nomadik.c
@@ -1367,7 +1367,7 @@ static const char *nmk_find_pin_name(struct pinctrl_dev *pctldev, const char *pi
 static bool nmk_pinctrl_dt_get_config(struct device_node *np,
 		unsigned long *configs)
 {
-	bool has_config = 0;
+	bool has_config = false;
 	unsigned long cfg = 0;
 	int i, val, ret;
 
@@ -1377,7 +1377,7 @@ static bool nmk_pinctrl_dt_get_config(struct device_node *np,
 		if (ret != -EINVAL) {
 			if (nmk_dt_pin_config(i, val, &cfg) == 0) {
 				*configs |= cfg;
-				has_config = 1;
+				has_config = true;
 			}
 		}
 	}
@@ -1394,7 +1394,7 @@ static int nmk_pinctrl_dt_subnode_to_map(struct pinctrl_dev *pctldev,
 	int ret;
 	const char *function = NULL;
 	unsigned long configs = 0;
-	bool has_config = 0;
+	bool has_config = false;
 	struct property *prop;
 	struct device_node *np_config;
 
-- 
1.8.3.1




More information about the linux-arm-kernel mailing list