Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1692504 > unrolled thread

[PATCH V1 05/12] spmi: pmic-arb: fix memory allocation for mapping_table

Started byKiran Gunda <kgunda@codeaurora.org>
First post2017-07-20 09:40 +0200
Last post2017-07-28 07:40 +0200
Articles 4 — 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.


Contents

  [PATCH V1 05/12] spmi: pmic-arb: fix memory allocation for mapping_table Kiran Gunda <kgunda@codeaurora.org> - 2017-07-20 09:40 +0200
    Re: [PATCH V1 05/12] spmi: pmic-arb: fix memory allocation for  mapping_table Stephen Boyd <sboyd@codeaurora.org> - 2017-07-28 01:50 +0200
      Re: [PATCH V1 05/12] spmi: pmic-arb: fix memory allocation for  mapping_table Stephen Boyd <sboyd@codeaurora.org> - 2017-07-28 02:10 +0200
      Re: [PATCH V1 05/12] spmi: pmic-arb: fix memory allocation for  mapping_table kgunda@codeaurora.org - 2017-07-28 07:40 +0200

#1692504 — [PATCH V1 05/12] spmi: pmic-arb: fix memory allocation for mapping_table

FromKiran Gunda <kgunda@codeaurora.org>
Date2017-07-20 09:40 +0200
Subject[PATCH V1 05/12] spmi: pmic-arb: fix memory allocation for mapping_table
Message-ID<u5edY-46l-11@gated-at.bofh.it>
Allocate the correct memory size (max_pmic_peripherals) for the
mapping_table that holds the apid to ppid mapping. Also use a local
variable for mapping_table for better alignment of the code.

Signed-off-by: Kiran Gunda <kgunda@codeaurora.org>
---
 drivers/spmi/spmi-pmic-arb.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/drivers/spmi/spmi-pmic-arb.c b/drivers/spmi/spmi-pmic-arb.c
index 0c98495..b32b5b0 100644
--- a/drivers/spmi/spmi-pmic-arb.c
+++ b/drivers/spmi/spmi-pmic-arb.c
@@ -929,6 +929,7 @@ static int spmi_pmic_arb_probe(struct platform_device *pdev)
 	struct spmi_controller *ctrl;
 	struct resource *res;
 	void __iomem *core;
+	u32 *mapping_table;
 	u32 channel, ee, hw_ver;
 	int err;
 
@@ -1038,16 +1039,14 @@ static int spmi_pmic_arb_probe(struct platform_device *pdev)
 	}
 
 	pmic_arb->ee = ee;
-
-	pmic_arb->mapping_table = devm_kcalloc(&ctrl->dev,
-					PMIC_ARB_MAX_PERIPHS - 1,
-					sizeof(*pmic_arb->mapping_table),
-					GFP_KERNEL);
-	if (!pmic_arb->mapping_table) {
+	mapping_table = devm_kcalloc(&ctrl->dev, PMIC_ARB_MAX_PERIPHS,
+					sizeof(*mapping_table), GFP_KERNEL);
+	if (!mapping_table) {
 		err = -ENOMEM;
 		goto err_put_ctrl;
 	}
 
+	pmic_arb->mapping_table = mapping_table;
 	/* Initialize max_apid/min_apid to the opposite bounds, during
 	 * the irq domain translation, we are sure to update these */
 	pmic_arb->max_apid = 0;
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

[toc] | [next] | [standalone]


#1698368 — Re: [PATCH V1 05/12] spmi: pmic-arb: fix memory allocation for mapping_table

FromStephen Boyd <sboyd@codeaurora.org>
Date2017-07-28 01:50 +0200
SubjectRe: [PATCH V1 05/12] spmi: pmic-arb: fix memory allocation for mapping_table
Message-ID<u80Hw-4iN-5@gated-at.bofh.it>
In reply to#1692504
On 07/20, Kiran Gunda wrote:
> Allocate the correct memory size (max_pmic_peripherals) for the
> mapping_table that holds the apid to ppid mapping. Also use a local
> variable for mapping_table for better alignment of the code.
> 
> Signed-off-by: Kiran Gunda <kgunda@codeaurora.org>

This needs a

Fixes: 987a9f128b8a ("spmi: pmic-arb: Support more than 128 peripherals")

right?

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

[toc] | [prev] | [next] | [standalone]


#1698377 — Re: [PATCH V1 05/12] spmi: pmic-arb: fix memory allocation for mapping_table

FromStephen Boyd <sboyd@codeaurora.org>
Date2017-07-28 02:10 +0200
SubjectRe: [PATCH V1 05/12] spmi: pmic-arb: fix memory allocation for mapping_table
Message-ID<u810R-4Ek-15@gated-at.bofh.it>
In reply to#1698368
On 07/27, Stephen Boyd wrote:
> On 07/20, Kiran Gunda wrote:
> > Allocate the correct memory size (max_pmic_peripherals) for the
> > mapping_table that holds the apid to ppid mapping. Also use a local
> > variable for mapping_table for better alignment of the code.
> > 
> > Signed-off-by: Kiran Gunda <kgunda@codeaurora.org>
> 
> This needs a
> 
> Fixes: 987a9f128b8a ("spmi: pmic-arb: Support more than 128 peripherals")
> 
> right?
> 

Otherwise it has my 

Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

[toc] | [prev] | [next] | [standalone]


#1698478 — Re: [PATCH V1 05/12] spmi: pmic-arb: fix memory allocation for mapping_table

Fromkgunda@codeaurora.org
Date2017-07-28 07:40 +0200
SubjectRe: [PATCH V1 05/12] spmi: pmic-arb: fix memory allocation for mapping_table
Message-ID<u86ae-7YD-7@gated-at.bofh.it>
In reply to#1698368
On 2017-07-28 05:19, Stephen Boyd wrote:
> On 07/20, Kiran Gunda wrote:
>> Allocate the correct memory size (max_pmic_peripherals) for the
>> mapping_table that holds the apid to ppid mapping. Also use a local
>> variable for mapping_table for better alignment of the code.
>> 
>> Signed-off-by: Kiran Gunda <kgunda@codeaurora.org>
> 
> This needs a
> 
> Fixes: 987a9f128b8a ("spmi: pmic-arb: Support more than 128 
> peripherals")
> 
> right?
Yes. I will keep the tag and send it again.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web