From: Stephen Boyd <sboyd@codeaurora.org>
To: Timur Tabi <timur@codeaurora.org>
Cc: Pramod Gurav <pramod.gurav@smartplayin.com>,
Bjorn Andersson <bjorn.andersson@sonymobile.com>,
linux-arm-msm@vger.kernel.org,
Linus Walleij <linus.walleij@linaro.org>,
lkml <linux-kernel@vger.kernel.org>,
"Ivan T. Ivanov" <iivanov@mm-sol.com>,
Andy Gross <agross@codeaurora.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH v3 4/4] pinctrl: qcom: Add support for reset for apq8064
Date: Wed, 14 Jan 2015 16:23:10 -0800 [thread overview]
Message-ID: <54B7086E.7060807@codeaurora.org> (raw)
In-Reply-To: <CAOZdJXXZ3RH1zOGcz1L58d9DV_LSZtUxYVKe6ssM71nyhnbMyg@mail.gmail.com>
On 01/14/2015 03:54 PM, Timur Tabi wrote:
> On Wed, Jan 14, 2015 at 5:44 PM, Stephen Boyd <sboyd@codeaurora.org> wrote:
>> I think so. Can you send a patch? Plus it would be nice to move i = 0 in
>> the for loop at the same time.
> Sadly, Qualcomm policy makes that very cumbersome for me. I won't be
> able to send a patch any time soon.
>
Hm... we'll have to figure out that part. Anyway here's the patch.
---8<----
From: Stephen Boyd <sboyd@codeaurora.org>
Subject: [PATCH] pinctrl: qcom: Don't iterate past end of function array
Timur reports that this code crashes if nfunctions is 0. Fix the
loop iteration to only consider valid elements of the functions
array.
Reported-by: Timur Tabi <timur@codeaurora.org>
Cc: Pramod Gurav <pramod.gurav@smartplayin.com>
Cc: Bjorn Andersson <bjorn.andersson@sonymobile.com>
Cc: Ivan T. Ivanov <iivanov@mm-sol.com>
Cc: Andy Gross <agross@codeaurora.org>
Fixes: 327455817a92 "pinctrl: qcom: Add support for reset for apq8064"
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
---
drivers/pinctrl/qcom/pinctrl-msm.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/pinctrl/qcom/pinctrl-msm.c b/drivers/pinctrl/qcom/pinctrl-msm.c
index e730935fa457..ed7017df065d 100644
--- a/drivers/pinctrl/qcom/pinctrl-msm.c
+++ b/drivers/pinctrl/qcom/pinctrl-msm.c
@@ -865,10 +865,10 @@ static int msm_ps_hold_restart(struct notifier_block *nb, unsigned long action,
static void msm_pinctrl_setup_pm_reset(struct msm_pinctrl *pctrl)
{
- int i = 0;
+ int i;
const struct msm_function *func = pctrl->soc->functions;
- for (; i <= pctrl->soc->nfunctions; i++)
+ for (i = 0; i < pctrl->soc->nfunctions; i++)
if (!strcmp(func[i].name, "ps_hold")) {
pctrl->restart_nb.notifier_call = msm_ps_hold_restart;
pctrl->restart_nb.priority = 128;
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
WARNING: multiple messages have this Message-ID (diff)
From: sboyd@codeaurora.org (Stephen Boyd)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 4/4] pinctrl: qcom: Add support for reset for apq8064
Date: Wed, 14 Jan 2015 16:23:10 -0800 [thread overview]
Message-ID: <54B7086E.7060807@codeaurora.org> (raw)
In-Reply-To: <CAOZdJXXZ3RH1zOGcz1L58d9DV_LSZtUxYVKe6ssM71nyhnbMyg@mail.gmail.com>
On 01/14/2015 03:54 PM, Timur Tabi wrote:
> On Wed, Jan 14, 2015 at 5:44 PM, Stephen Boyd <sboyd@codeaurora.org> wrote:
>> I think so. Can you send a patch? Plus it would be nice to move i = 0 in
>> the for loop at the same time.
> Sadly, Qualcomm policy makes that very cumbersome for me. I won't be
> able to send a patch any time soon.
>
Hm... we'll have to figure out that part. Anyway here's the patch.
---8<----
From: Stephen Boyd <sboyd@codeaurora.org>
Subject: [PATCH] pinctrl: qcom: Don't iterate past end of function array
Timur reports that this code crashes if nfunctions is 0. Fix the
loop iteration to only consider valid elements of the functions
array.
Reported-by: Timur Tabi <timur@codeaurora.org>
Cc: Pramod Gurav <pramod.gurav@smartplayin.com>
Cc: Bjorn Andersson <bjorn.andersson@sonymobile.com>
Cc: Ivan T. Ivanov <iivanov@mm-sol.com>
Cc: Andy Gross <agross@codeaurora.org>
Fixes: 327455817a92 "pinctrl: qcom: Add support for reset for apq8064"
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
---
drivers/pinctrl/qcom/pinctrl-msm.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/pinctrl/qcom/pinctrl-msm.c b/drivers/pinctrl/qcom/pinctrl-msm.c
index e730935fa457..ed7017df065d 100644
--- a/drivers/pinctrl/qcom/pinctrl-msm.c
+++ b/drivers/pinctrl/qcom/pinctrl-msm.c
@@ -865,10 +865,10 @@ static int msm_ps_hold_restart(struct notifier_block *nb, unsigned long action,
static void msm_pinctrl_setup_pm_reset(struct msm_pinctrl *pctrl)
{
- int i = 0;
+ int i;
const struct msm_function *func = pctrl->soc->functions;
- for (; i <= pctrl->soc->nfunctions; i++)
+ for (i = 0; i < pctrl->soc->nfunctions; i++)
if (!strcmp(func[i].name, "ps_hold")) {
pctrl->restart_nb.notifier_call = msm_ps_hold_restart;
pctrl->restart_nb.priority = 128;
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
next prev parent reply other threads:[~2015-01-15 0:23 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-29 14:30 [PATCH v3 0/4] Add reset support for apq8064 Pramod Gurav
2014-08-29 14:30 ` Pramod Gurav
2014-08-29 14:30 ` [PATCH v3 1/4] ARM: DT: APQ8064: Add pinctrl support Pramod Gurav
2014-08-29 14:30 ` Pramod Gurav
2014-08-29 14:30 ` [PATCH v3 2/4] ARM: DT: APQ8064: Add node for ps_hold function in pinctrl Pramod Gurav
2014-08-29 14:30 ` Pramod Gurav
2014-08-29 14:30 ` [PATCH v3 3/4] pinctrl: msm: Add ps_hold function in pinctrl-apq8064 binding documentation Pramod Gurav
2014-08-29 14:30 ` Pramod Gurav
2014-09-02 12:31 ` Linus Walleij
2014-09-02 12:31 ` Linus Walleij
2014-08-29 14:30 ` [PATCH v3 4/4] pinctrl: qcom: Add support for reset for apq8064 Pramod Gurav
2014-08-29 14:30 ` Pramod Gurav
2014-08-29 18:42 ` Bjorn Andersson
2014-08-29 18:42 ` Bjorn Andersson
2014-08-30 5:08 ` Pramod Gurav
2014-08-30 5:08 ` Pramod Gurav
2014-09-02 12:36 ` Linus Walleij
2014-09-02 12:36 ` Linus Walleij
2014-09-02 17:06 ` Bjorn Andersson
2014-09-02 17:06 ` Bjorn Andersson
2015-01-14 23:38 ` Timur Tabi
2015-01-14 23:38 ` Timur Tabi
2015-01-14 23:44 ` Stephen Boyd
2015-01-14 23:44 ` Stephen Boyd
2015-01-14 23:54 ` Timur Tabi
2015-01-14 23:54 ` Timur Tabi
2015-01-15 0:23 ` Stephen Boyd [this message]
2015-01-15 0:23 ` Stephen Boyd
2015-01-19 10:18 ` Linus Walleij
2015-01-19 10:18 ` 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=54B7086E.7060807@codeaurora.org \
--to=sboyd@codeaurora.org \
--cc=agross@codeaurora.org \
--cc=bjorn.andersson@sonymobile.com \
--cc=iivanov@mm-sol.com \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pramod.gurav@smartplayin.com \
--cc=timur@codeaurora.org \
/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.