linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][next] pinctrl: eswin: Fix unsigned comparison to less than zero issue
@ 2025-06-23 22:20 Colin Ian King
  2025-06-24 19:38 ` Linus Walleij
  0 siblings, 1 reply; 2+ messages in thread
From: Colin Ian King @ 2025-06-23 22:20 UTC (permalink / raw)
  To: Linus Walleij, Yulin Lu, Samuel Holland, linux-gpio
  Cc: kernel-janitors, linux-kernel

The u32 variable voltage is being compared to less than zero and
this can never be true. Fix this by making voltage an int type which
is the same type as the return from the call to regulator_get_voltage.

Fixes: 5b797bcc00ef ("pinctrl: eswin: Add EIC7700 pinctrl driver")
Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
 drivers/pinctrl/pinctrl-eic7700.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/pinctrl/pinctrl-eic7700.c b/drivers/pinctrl/pinctrl-eic7700.c
index 719cd11e276a..4874b5532343 100644
--- a/drivers/pinctrl/pinctrl-eic7700.c
+++ b/drivers/pinctrl/pinctrl-eic7700.c
@@ -622,8 +622,8 @@ static int eic7700_pinctrl_probe(struct platform_device *pdev)
 	struct pinctrl_dev *pctldev;
 	struct eic7700_pinctrl *pc;
 	struct regulator *regulator;
-	u32 voltage, rgmii0_mode, rgmii1_mode;
-	int ret;
+	u32 rgmii0_mode, rgmii1_mode;
+	int ret, voltage;
 
 	pc = devm_kzalloc(dev, struct_size(pc, functions, EIC7700_FUNCTIONS_COUNT), GFP_KERNEL);
 	if (!pc)
-- 
2.50.0


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

* Re: [PATCH][next] pinctrl: eswin: Fix unsigned comparison to less than zero issue
  2025-06-23 22:20 [PATCH][next] pinctrl: eswin: Fix unsigned comparison to less than zero issue Colin Ian King
@ 2025-06-24 19:38 ` Linus Walleij
  0 siblings, 0 replies; 2+ messages in thread
From: Linus Walleij @ 2025-06-24 19:38 UTC (permalink / raw)
  To: Colin Ian King
  Cc: Yulin Lu, Samuel Holland, linux-gpio, kernel-janitors,
	linux-kernel

On Tue, Jun 24, 2025 at 12:20 AM Colin Ian King <colin.i.king@gmail.com> wrote:

> The u32 variable voltage is being compared to less than zero and
> this can never be true. Fix this by making voltage an int type which
> is the same type as the return from the call to regulator_get_voltage.
>
> Fixes: 5b797bcc00ef ("pinctrl: eswin: Add EIC7700 pinctrl driver")
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>

Patch applied!

Yours,
Linus Walleij

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

end of thread, other threads:[~2025-06-24 19:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-23 22:20 [PATCH][next] pinctrl: eswin: Fix unsigned comparison to less than zero issue Colin Ian King
2025-06-24 19:38 ` Linus Walleij

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).