Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1692505 > unrolled thread
| Started by | Kiran Gunda <kgunda@codeaurora.org> |
|---|---|
| First post | 2017-07-20 09:40 +0200 |
| Last post | 2017-07-28 07:40 +0200 |
| Articles | 3 — 3 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
[PATCH V1 03/12] spmi: pmic-arb: clean up pmic_arb_find_apid function Kiran Gunda <kgunda@codeaurora.org> - 2017-07-20 09:40 +0200
Re: [PATCH V1 03/12] spmi: pmic-arb: clean up pmic_arb_find_apid function Stephen Boyd <sboyd@codeaurora.org> - 2017-07-28 03:20 +0200
Re: [PATCH V1 03/12] spmi: pmic-arb: clean up pmic_arb_find_apid function kgunda@codeaurora.org - 2017-07-28 07:40 +0200
| From | Kiran Gunda <kgunda@codeaurora.org> |
|---|---|
| Date | 2017-07-20 09:40 +0200 |
| Subject | [PATCH V1 03/12] spmi: pmic-arb: clean up pmic_arb_find_apid function |
| Message-ID | <u5edZ-46l-33@gated-at.bofh.it> |
Clean up the pmic_arb_find_apid() by using the local
variables to improve the code readability.
Signed-off-by: Kiran Gunda <kgunda@codeaurora.org>
---
drivers/spmi/spmi-pmic-arb.c | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/drivers/spmi/spmi-pmic-arb.c b/drivers/spmi/spmi-pmic-arb.c
index 530fa11..cd78665 100644
--- a/drivers/spmi/spmi-pmic-arb.c
+++ b/drivers/spmi/spmi-pmic-arb.c
@@ -762,23 +762,22 @@ static int pmic_arb_offset_v1(struct spmi_pmic_arb *pmic_arb, u8 sid, u16 addr,
static u16 pmic_arb_find_apid(struct spmi_pmic_arb *pmic_arb, u16 ppid)
{
+ struct apid_data *apidd = &pmic_arb->apid_data[pmic_arb->last_apid];
u32 regval, offset;
- u16 apid;
- u16 id;
+ u16 id, apid;
/*
- * 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 = pmic_arb->last_apid; ; apid++) {
+ for (apid = pmic_arb->last_apid; ; apid++, apidd++) {
offset = PMIC_ARB_REG_APID(apid);
if (offset >= pmic_arb->core_size)
break;
regval = readl_relaxed(pmic_arb->cnfg +
- SPMI_OWNERSHIP_TABLE_REG(apid));
- pmic_arb->apid_data[apid].owner =
- SPMI_OWNERSHIP_PERIPH2OWNER(regval);
+ SPMI_OWNERSHIP_TABLE_REG(apid));
+ apidd->owner = SPMI_OWNERSHIP_PERIPH2OWNER(regval);
regval = readl_relaxed(pmic_arb->core + offset);
if (!regval)
@@ -786,7 +785,7 @@ static u16 pmic_arb_find_apid(struct spmi_pmic_arb *pmic_arb, u16 ppid)
id = (regval >> 8) & PMIC_ARB_PPID_MASK;
pmic_arb->ppid_to_apid[id] = apid | PMIC_ARB_APID_VALID;
- pmic_arb->apid_data[apid].ppid = id;
+ apidd->ppid = id;
if (id == ppid) {
apid |= PMIC_ARB_APID_VALID;
break;
--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
[toc] | [next] | [standalone]
| From | Stephen Boyd <sboyd@codeaurora.org> |
|---|---|
| Date | 2017-07-28 03:20 +0200 |
| Subject | Re: [PATCH V1 03/12] spmi: pmic-arb: clean up pmic_arb_find_apid function |
| Message-ID | <u826B-5lO-5@gated-at.bofh.it> |
| In reply to | #1692505 |
On 07/20, Kiran Gunda wrote: > Clean up the pmic_arb_find_apid() by using the local > variables to improve the code readability. > > Signed-off-by: Kiran Gunda <kgunda@codeaurora.org> > --- Reviewed-by: Stephen Boyd <sboyd@codeaurora.org> One nit below: > break; > > regval = readl_relaxed(pmic_arb->cnfg + > - SPMI_OWNERSHIP_TABLE_REG(apid)); > - pmic_arb->apid_data[apid].owner = > - SPMI_OWNERSHIP_PERIPH2OWNER(regval); > + SPMI_OWNERSHIP_TABLE_REG(apid)); This should be 7 spaces and not a tab? Originally looks like it was 6 spaces -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project
[toc] | [prev] | [next] | [standalone]
| From | kgunda@codeaurora.org |
|---|---|
| Date | 2017-07-28 07:40 +0200 |
| Subject | Re: [PATCH V1 03/12] spmi: pmic-arb: clean up pmic_arb_find_apid function |
| Message-ID | <u86ae-7YD-9@gated-at.bofh.it> |
| In reply to | #1698394 |
On 2017-07-28 06:48, Stephen Boyd wrote: > On 07/20, Kiran Gunda wrote: >> Clean up the pmic_arb_find_apid() by using the local >> variables to improve the code readability. >> >> Signed-off-by: Kiran Gunda <kgunda@codeaurora.org> >> --- > > Reviewed-by: Stephen Boyd <sboyd@codeaurora.org> > > One nit below: > >> break; >> >> regval = readl_relaxed(pmic_arb->cnfg + >> - SPMI_OWNERSHIP_TABLE_REG(apid)); >> - pmic_arb->apid_data[apid].owner = >> - SPMI_OWNERSHIP_PERIPH2OWNER(regval); >> + SPMI_OWNERSHIP_TABLE_REG(apid)); > > This should be 7 spaces and not a tab? Originally looks like it > was 6 spaces Will fix it and send the next patch.
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web