From: Dan Carpenter <dan.carpenter@oracle.com>
To: Damien Le Moal <damien.lemoal@wdc.com>
Cc: Linus Walleij <linus.walleij@linaro.org>,
Sean Anderson <seanga2@gmail.com>,
Palmer Dabbelt <palmerdabbelt@google.com>,
linux-riscv@lists.infradead.org, linux-gpio@vger.kernel.org,
kernel-janitors@vger.kernel.org
Subject: [PATCH] pinctrl: fix loop in k210_pinconf_get_drive()
Date: Wed, 9 Feb 2022 21:08:06 +0300 [thread overview]
Message-ID: <20220209180804.GA18385@kili> (raw)
The loop exited too early so the k210_pinconf_drive_strength[0] array
element was never used.
Fixes: d4c34d09ab03 ("pinctrl: Add RISC-V Canaan Kendryte K210 FPIOA driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
drivers/pinctrl/pinctrl-k210.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/pinctrl/pinctrl-k210.c b/drivers/pinctrl/pinctrl-k210.c
index 49e32684dbb2..e3d03f2de7ef 100644
--- a/drivers/pinctrl/pinctrl-k210.c
+++ b/drivers/pinctrl/pinctrl-k210.c
@@ -482,7 +482,7 @@ static int k210_pinconf_get_drive(unsigned int max_strength_ua)
{
int i;
- for (i = K210_PC_DRIVE_MAX; i; i--) {
+ for (i = K210_PC_DRIVE_MAX; i >= 0; i--) {
if (k210_pinconf_drive_strength[i] <= max_strength_ua)
return i;
}
--
2.20.1
WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Damien Le Moal <damien.lemoal@wdc.com>
Cc: Linus Walleij <linus.walleij@linaro.org>,
Sean Anderson <seanga2@gmail.com>,
Palmer Dabbelt <palmerdabbelt@google.com>,
linux-riscv@lists.infradead.org, linux-gpio@vger.kernel.org,
kernel-janitors@vger.kernel.org
Subject: [PATCH] pinctrl: fix loop in k210_pinconf_get_drive()
Date: Wed, 9 Feb 2022 21:08:06 +0300 [thread overview]
Message-ID: <20220209180804.GA18385@kili> (raw)
The loop exited too early so the k210_pinconf_drive_strength[0] array
element was never used.
Fixes: d4c34d09ab03 ("pinctrl: Add RISC-V Canaan Kendryte K210 FPIOA driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
drivers/pinctrl/pinctrl-k210.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/pinctrl/pinctrl-k210.c b/drivers/pinctrl/pinctrl-k210.c
index 49e32684dbb2..e3d03f2de7ef 100644
--- a/drivers/pinctrl/pinctrl-k210.c
+++ b/drivers/pinctrl/pinctrl-k210.c
@@ -482,7 +482,7 @@ static int k210_pinconf_get_drive(unsigned int max_strength_ua)
{
int i;
- for (i = K210_PC_DRIVE_MAX; i; i--) {
+ for (i = K210_PC_DRIVE_MAX; i >= 0; i--) {
if (k210_pinconf_drive_strength[i] <= max_strength_ua)
return i;
}
--
2.20.1
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
next reply other threads:[~2022-02-09 18:08 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-09 18:08 Dan Carpenter [this message]
2022-02-09 18:08 ` [PATCH] pinctrl: fix loop in k210_pinconf_get_drive() Dan Carpenter
2022-02-09 18:13 ` Sean Anderson
2022-02-09 18:13 ` Sean Anderson
2022-02-09 23:32 ` Damien Le Moal
2022-02-09 23:32 ` Damien Le Moal
2022-02-11 1:19 ` Linus Walleij
2022-02-11 1:19 ` Linus Walleij
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220209180804.GA18385@kili \
--to=dan.carpenter@oracle.com \
--cc=damien.lemoal@wdc.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=palmerdabbelt@google.com \
--cc=seanga2@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.