linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] pinctrl: rzn1: Fix check for used MDIO bus
@ 2018-11-19 16:18 Phil Edworthy
  2018-11-22 14:08 ` Simon Horman
  2018-11-23  9:40 ` Geert Uytterhoeven
  0 siblings, 2 replies; 9+ messages in thread
From: Phil Edworthy @ 2018-11-19 16:18 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Jacopo Mondi, Linus Walleij, linux-gpio, linux-kernel,
	linux-renesas-soc, Phil Edworthy

This fixes the check for unused mdio bus setting and the following static
checker warning:
 drivers/pinctrl/pinctrl-rzn1.c:198 rzn1_pinctrl_mdio_select()
 warn: always true condition '(ipctl->mdio_func[mdio] >= 0) => (0-u32max >= 0)'

It also fixes the return var when calling of_get_child_count()

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Phil Edworthy <phil.edworthy@renesas.com>
---
v2:
 - Don't rely on rely on the implicit typecast from -1 to uint
---
 drivers/pinctrl/pinctrl-rzn1.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/pinctrl/pinctrl-rzn1.c b/drivers/pinctrl/pinctrl-rzn1.c
index 57886dcff53d..cc0e5aa9128a 100644
--- a/drivers/pinctrl/pinctrl-rzn1.c
+++ b/drivers/pinctrl/pinctrl-rzn1.c
@@ -112,7 +112,7 @@ struct rzn1_pinctrl {
 	struct rzn1_pinctrl_regs __iomem *lev2;
 	u32 lev1_protect_phys;
 	u32 lev2_protect_phys;
-	u32 mdio_func[2];
+	int mdio_func[2];
 
 	struct rzn1_pin_group *groups;
 	unsigned int ngroups;
@@ -810,8 +810,8 @@ static int rzn1_pinctrl_probe_dt(struct platform_device *pdev,
 	struct device_node *np = pdev->dev.of_node;
 	struct device_node *child;
 	unsigned int maxgroups = 0;
-	unsigned int nfuncs = 0;
 	unsigned int i = 0;
+	int nfuncs = 0;
 	int ret;
 
 	nfuncs = of_get_child_count(np);
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 9+ messages in thread
* [PATCH] pinctrl: rzn1: Fix check for used MDIO bus
@ 2018-11-23 10:54 Phil Edworthy
  2018-11-23 12:04 ` Geert Uytterhoeven
  0 siblings, 1 reply; 9+ messages in thread
From: Phil Edworthy @ 2018-11-23 10:54 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Jacopo Mondi, Linus Walleij, linux-gpio, linux-kernel,
	linux-renesas-soc, Phil Edworthy

This fixes the check for unused mdio bus setting and the following static
checker warning:
 drivers/pinctrl/pinctrl-rzn1.c:198 rzn1_pinctrl_mdio_select()
 warn: always true condition '(ipctl->mdio_func[mdio] >= 0) => (0-u32max >= 0)'

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Phil Edworthy <phil.edworthy@renesas.com>
---
v3:
 - Split fixing the return var when calling of_get_child_count() into
   a separate patch.
v2:
 - Don't rely on rely on the implicit typecast from -1 to uint
---
 drivers/pinctrl/pinctrl-rzn1.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pinctrl/pinctrl-rzn1.c b/drivers/pinctrl/pinctrl-rzn1.c
index 57886dcff53d..a04235e3bec4 100644
--- a/drivers/pinctrl/pinctrl-rzn1.c
+++ b/drivers/pinctrl/pinctrl-rzn1.c
@@ -112,7 +112,7 @@ struct rzn1_pinctrl {
 	struct rzn1_pinctrl_regs __iomem *lev2;
 	u32 lev1_protect_phys;
 	u32 lev2_protect_phys;
-	u32 mdio_func[2];
+	int mdio_func[2];
 
 	struct rzn1_pin_group *groups;
 	unsigned int ngroups;
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2018-11-23 12:04 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-11-19 16:18 [PATCH] pinctrl: rzn1: Fix check for used MDIO bus Phil Edworthy
2018-11-22 14:08 ` Simon Horman
2018-11-22 14:36   ` Phil Edworthy
2018-11-23  9:40 ` Geert Uytterhoeven
2018-11-23 10:01   ` Phil Edworthy
2018-11-23 10:16     ` Geert Uytterhoeven
2018-11-23 11:06       ` Phil Edworthy
  -- strict thread matches above, loose matches on Subject: below --
2018-11-23 10:54 Phil Edworthy
2018-11-23 12:04 ` Geert Uytterhoeven

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).