From: kgunda@codeaurora.org
To: Stephen Boyd <sboyd@codeaurora.org>
Cc: gregkh@linuxfoundation.org,
Abhijeet Dharmapurikar <adharmap@codeaurora.org>,
Christophe JAILLET <christophe.jaillet@wanadoo.fr>,
linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org,
linux-arm-msm-owner@vger.kernel.org
Subject: Re: [PATCH V2 2/5] spmi: pmic-arb: rename pa_xx to pmic_arb_xx and other code cleanup
Date: Tue, 18 Jul 2017 10:22:44 +0530 [thread overview]
Message-ID: <fb76cd144632eb1bb178550191ea9250@codeaurora.org> (raw)
In-Reply-To: <20170714182016.GJ22780@codeaurora.org>
On 2017-07-14 23:50, Stephen Boyd wrote:
> On 07/10, Kiran Gunda wrote:
>>
>> -static u16 pmic_arb_find_apid(struct spmi_pmic_arb *pa, u16 ppid)
>> +static u16 pmic_arb_find_apid(struct spmi_pmic_arb *pmic_arb, u16
>> ppid)
>> {
>> + struct apid_data *apid_info =
>> &pmic_arb->apid_data[pmic_arb->last_apid];
>> u32 regval, offset;
>> - u16 apid;
>> - u16 id;
>> + u16 id, i;
>>
>> /*
>> - * PMIC_ARB_REG_CHNL is a table in HW mapping channel to ppid.
>> + * PMIC_ARB_REG_APID is a table in HW mapping apid to ppid.
>> * ppid_to_apid is an in-memory invert of that table.
>> */
>> - for (apid = pa->last_apid; ; apid++) {
>> - offset = PMIC_ARB_REG_CHNL(apid);
>> - if (offset >= pa->core_size)
>> + for (i = pmic_arb->last_apid; ; i++, apid_info++) {
>
> Can we keep apid instead of replacing it with i please? That will
> reduce the noise in this function.
>
Sure. Will do that in the next patch.
>> + offset = PMIC_ARB_REG_CHNL(i);
>> + if (offset >= pmic_arb->core_size)
>> break;
>>
>> - regval = readl_relaxed(pa->cnfg +
>> - SPMI_OWNERSHIP_TABLE_REG(apid));
>> - pa->apid_data[apid].owner = SPMI_OWNERSHIP_PERIPH2OWNER(regval);
>> + regval = readl_relaxed(pmic_arb->cnfg +
>> + SPMI_OWNERSHIP_TABLE_REG(i));
>> + apid_info->owner = SPMI_OWNERSHIP_PERIPH2OWNER(regval);
>>
>> - regval = readl_relaxed(pa->core + offset);
>> + regval = readl_relaxed(pmic_arb->core + offset);
>> if (!regval)
>> continue;
>>
>> id = (regval >> 8) & PMIC_ARB_PPID_MASK;
>> - pa->ppid_to_apid[id] = apid | PMIC_ARB_CHAN_VALID;
>> - pa->apid_data[apid].ppid = id;
>> + pmic_arb->ppid_to_apid[id] = i | PMIC_ARB_APID_VALID;
>> + apid_info->ppid = id;
>> if (id == ppid) {
>> - apid |= PMIC_ARB_CHAN_VALID;
>> + i |= PMIC_ARB_APID_VALID;
>> break;
>> }
>> }
>> - pa->last_apid = apid & ~PMIC_ARB_CHAN_VALID;
>> + pmic_arb->last_apid = i & ~PMIC_ARB_APID_VALID;
>>
>> - return apid;
>> + return i;
>> }
>
> Otherwise patch looks ok.
next prev parent reply other threads:[~2017-07-18 4:52 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-10 12:42 [PATCH V2 0/5]: spmi: pmic-arb: Fixup patches Kiran Gunda
2017-07-10 12:42 ` [PATCH V2 1/5] spmi: pmic-arb: remove the read/write access checks Kiran Gunda
2017-07-10 12:42 ` [PATCH V2 2/5] spmi: pmic-arb: rename pa_xx to pmic_arb_xx and other code cleanup Kiran Gunda
2017-07-14 18:20 ` Stephen Boyd
2017-07-18 4:52 ` kgunda [this message]
2017-07-10 12:42 ` [PATCH V2 3/5] spmi: pmic-arb: replace the writel_relaxed with __raw_writel Kiran Gunda
2017-07-10 12:42 ` [PATCH V2 4/5] spmi: pmic-arb: return the value instead of passing by pointer Kiran Gunda
2017-07-10 12:42 ` [PATCH V2 5/5] spmi: pmic-arb: use irq_chip callback to set spmi irq wakeup capability Kiran Gunda
2017-07-11 1:22 ` Stephen Boyd
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=fb76cd144632eb1bb178550191ea9250@codeaurora.org \
--to=kgunda@codeaurora.org \
--cc=adharmap@codeaurora.org \
--cc=christophe.jaillet@wanadoo.fr \
--cc=gregkh@linuxfoundation.org \
--cc=linux-arm-msm-owner@vger.kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sboyd@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 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).