* [PATCH 1/2] regulator: tps6586x-regulator - fix value range checking for val
@ 2010-08-22 14:38 Axel Lin
2010-08-22 14:42 ` [PATCH 2/2] regulator: tps6586x-regulator - fix bit_mask parameter for tps6586x_set_bits() Axel Lin
2010-08-23 10:01 ` [PATCH 1/2] regulator: tps6586x-regulator - fix value range checking for val Mark Brown
0 siblings, 2 replies; 9+ messages in thread
From: Axel Lin @ 2010-08-22 14:38 UTC (permalink / raw)
To: linux-kernel; +Cc: Liam Girdwood, Mark Brown, Mike Rapoport
val is used as array index of ri->voltages.
Thus the valid value range should be 0 .. ri->desc.n_voltages - 1.
Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
drivers/regulator/tps6586x-regulator.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/regulator/tps6586x-regulator.c b/drivers/regulator/tps6586x-regulator.c
index 8cff141..facd439 100644
--- a/drivers/regulator/tps6586x-regulator.c
+++ b/drivers/regulator/tps6586x-regulator.c
@@ -133,7 +133,7 @@ static int tps6586x_ldo_get_voltage(struct regulator_dev *rdev)
mask = ((1 << ri->volt_nbits) - 1) << ri->volt_shift;
val = (val & mask) >> ri->volt_shift;
- if (val > ri->desc.n_voltages)
+ if (val >= ri->desc.n_voltages)
BUG();
return ri->voltages[val] * 1000;
--
1.7.0.4
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 2/2] regulator: tps6586x-regulator - fix bit_mask parameter for tps6586x_set_bits()
2010-08-22 14:38 [PATCH 1/2] regulator: tps6586x-regulator - fix value range checking for val Axel Lin
@ 2010-08-22 14:42 ` Axel Lin
2010-08-23 10:02 ` Mark Brown
2010-08-23 10:01 ` [PATCH 1/2] regulator: tps6586x-regulator - fix value range checking for val Mark Brown
1 sibling, 1 reply; 9+ messages in thread
From: Axel Lin @ 2010-08-22 14:42 UTC (permalink / raw)
To: linux-kernel; +Cc: Liam Girdwood, Mark Brown, Mike Rapoport
The third parameter of tps6586x_set_bits() is the bit_mask,
thus we should use (1 << ri->go_bit) instead of ri->go_bit.
Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
drivers/regulator/tps6586x-regulator.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/regulator/tps6586x-regulator.c b/drivers/regulator/tps6586x-regulator.c
index facd439..51237fb 100644
--- a/drivers/regulator/tps6586x-regulator.c
+++ b/drivers/regulator/tps6586x-regulator.c
@@ -150,7 +150,7 @@ static int tps6586x_dvm_set_voltage(struct regulator_dev *rdev,
if (ret)
return ret;
- return tps6586x_set_bits(parent, ri->go_reg, ri->go_bit);
+ return tps6586x_set_bits(parent, ri->go_reg, 1 << ri->go_bit);
}
static int tps6586x_regulator_enable(struct regulator_dev *rdev)
--
1.7.0.4
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH 1/2] regulator: tps6586x-regulator - fix value range checking for val
2010-08-22 14:38 [PATCH 1/2] regulator: tps6586x-regulator - fix value range checking for val Axel Lin
2010-08-22 14:42 ` [PATCH 2/2] regulator: tps6586x-regulator - fix bit_mask parameter for tps6586x_set_bits() Axel Lin
@ 2010-08-23 10:01 ` Mark Brown
1 sibling, 0 replies; 9+ messages in thread
From: Mark Brown @ 2010-08-23 10:01 UTC (permalink / raw)
To: Axel Lin; +Cc: linux-kernel, Liam Girdwood, Mike Rapoport
On Sun, Aug 22, 2010 at 10:38:15PM +0800, Axel Lin wrote:
> val is used as array index of ri->voltages.
> Thus the valid value range should be 0 .. ri->desc.n_voltages - 1.
>
> Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 2/2] regulator: tps6586x-regulator - fix bit_mask parameter for tps6586x_set_bits()
2010-08-22 14:42 ` [PATCH 2/2] regulator: tps6586x-regulator - fix bit_mask parameter for tps6586x_set_bits() Axel Lin
@ 2010-08-23 10:02 ` Mark Brown
2010-08-23 10:09 ` Mike Rapoport
0 siblings, 1 reply; 9+ messages in thread
From: Mark Brown @ 2010-08-23 10:02 UTC (permalink / raw)
To: Axel Lin; +Cc: linux-kernel, Liam Girdwood, Mike Rapoport
On Sun, Aug 22, 2010 at 10:42:42PM +0800, Axel Lin wrote:
> The third parameter of tps6586x_set_bits() is the bit_mask,
> thus we should use (1 << ri->go_bit) instead of ri->go_bit.
>
> Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
but I'd be much happier if someone who actually has the hardware could
verify that this is OK.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 2/2] regulator: tps6586x-regulator - fix bit_mask parameter for tps6586x_set_bits()
2010-08-23 10:02 ` Mark Brown
@ 2010-08-23 10:09 ` Mike Rapoport
2010-08-25 9:53 ` Liam Girdwood
0 siblings, 1 reply; 9+ messages in thread
From: Mike Rapoport @ 2010-08-23 10:09 UTC (permalink / raw)
To: Mark Brown, Gary King; +Cc: Axel Lin, linux-kernel, Liam Girdwood
Mark Brown wrote:
> On Sun, Aug 22, 2010 at 10:42:42PM +0800, Axel Lin wrote:
>> The third parameter of tps6586x_set_bits() is the bit_mask,
>> thus we should use (1 << ri->go_bit) instead of ri->go_bit.
>>
>> Signed-off-by: Axel Lin <axel.lin@gmail.com>
>
> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
>
> but I'd be much happier if someone who actually has the hardware could
> verify that this is OK.
I don't have the hardware handy at the moment.
Gary, can you please verify the fix?
--
Sincerely yours,
Mike.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 2/2] regulator: tps6586x-regulator - fix bit_mask parameter for tps6586x_set_bits()
2010-08-23 10:09 ` Mike Rapoport
@ 2010-08-25 9:53 ` Liam Girdwood
2010-08-25 15:58 ` Gary King
2010-08-26 21:25 ` Gary King
0 siblings, 2 replies; 9+ messages in thread
From: Liam Girdwood @ 2010-08-25 9:53 UTC (permalink / raw)
To: Mike Rapoport; +Cc: Mark Brown, Gary King, Axel Lin, linux-kernel
On Mon, 2010-08-23 at 13:09 +0300, Mike Rapoport wrote:
> Mark Brown wrote:
> > On Sun, Aug 22, 2010 at 10:42:42PM +0800, Axel Lin wrote:
> >> The third parameter of tps6586x_set_bits() is the bit_mask,
> >> thus we should use (1 << ri->go_bit) instead of ri->go_bit.
> >>
> >> Signed-off-by: Axel Lin <axel.lin@gmail.com>
> >
> > Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
> >
> > but I'd be much happier if someone who actually has the hardware could
> > verify that this is OK.
>
> I don't have the hardware handy at the moment.
> Gary, can you please verify the fix?
>
Do we have any news on this testing ? I'd like to have these upstream
for rc3.
Thanks
Liam
--
Freelance Developer, SlimLogic Ltd
ASoC and Voltage Regulator Maintainer.
http://www.slimlogic.co.uk
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 2/2] regulator: tps6586x-regulator - fix bit_mask parameter for tps6586x_set_bits()
2010-08-25 9:53 ` Liam Girdwood
@ 2010-08-25 15:58 ` Gary King
2010-08-26 21:25 ` Gary King
1 sibling, 0 replies; 9+ messages in thread
From: Gary King @ 2010-08-25 15:58 UTC (permalink / raw)
To: Liam Girdwood; +Cc: Mike Rapoport, Mark Brown, Axel Lin, linux-kernel
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 1232 bytes --]
Sorry, I must have missed the original e-mail.
I'll give it a try either later today or tomorrow, after I
context-switch back to my dev system that uses the tps6586x driver.
- Gary
On 08/25/2010 02:53 AM, Liam Girdwood wrote:
>
> On Mon, 2010-08-23 at 13:09 +0300, Mike Rapoport wrote:
> > Mark Brown wrote:
> > > On Sun, Aug 22, 2010 at 10:42:42PM +0800, Axel Lin wrote:
> > >> The third parameter of tps6586x_set_bits() is the bit_mask,
> > >> thus we should use (1 << ri->go_bit) instead of ri->go_bit.
> > >>
> > >> Signed-off-by: Axel Lin <axel.lin@gmail.com>
> > >
> > > Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
> > >
> > > but I'd be much happier if someone who actually has the hardware could
> > > verify that this is OK.
> >
> > I don't have the hardware handy at the moment.
> > Gary, can you please verify the fix?
> >
>
> Do we have any news on this testing ? I'd like to have these upstream
> for rc3.
>
> Thanks
>
> Liam
> --
> Freelance Developer, SlimLogic Ltd
> ASoC and Voltage Regulator Maintainer.
> http://www.slimlogic.co.uk
>
ÿôèº{.nÇ+·®+%Ëÿ±éݶ\x17¥wÿº{.nÇ+·¥{±þG«éÿ{ayº\x1dÊÚë,j\a¢f£¢·hïêÿêçz_è®\x03(éÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?¨èÚ&£ø§~á¶iOæ¬z·vØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?I¥
^ permalink raw reply [flat|nested] 9+ messages in thread
* RE: [PATCH 2/2] regulator: tps6586x-regulator - fix bit_mask parameter for tps6586x_set_bits()
2010-08-25 9:53 ` Liam Girdwood
2010-08-25 15:58 ` Gary King
@ 2010-08-26 21:25 ` Gary King
2010-08-27 13:03 ` Liam Girdwood
1 sibling, 1 reply; 9+ messages in thread
From: Gary King @ 2010-08-26 21:25 UTC (permalink / raw)
To: Liam Girdwood, Mike Rapoport; +Cc: Mark Brown, Axel Lin, linux-kernel
The patch seems fine.
- Gary
________________________________________
From: Liam Girdwood [lrg@slimlogic.co.uk]
Sent: Wednesday, August 25, 2010 2:53 AM
To: Mike Rapoport
Cc: Mark Brown; Gary King; Axel Lin; linux-kernel
Subject: Re: [PATCH 2/2] regulator: tps6586x-regulator - fix bit_mask parameter for tps6586x_set_bits()
On Mon, 2010-08-23 at 13:09 +0300, Mike Rapoport wrote:
> Mark Brown wrote:
> > On Sun, Aug 22, 2010 at 10:42:42PM +0800, Axel Lin wrote:
> >> The third parameter of tps6586x_set_bits() is the bit_mask,
> >> thus we should use (1 << ri->go_bit) instead of ri->go_bit.
> >>
> >> Signed-off-by: Axel Lin <axel.lin@gmail.com>
> >
> > Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
> >
> > but I'd be much happier if someone who actually has the hardware could
> > verify that this is OK.
>
> I don't have the hardware handy at the moment.
> Gary, can you please verify the fix?
>
Do we have any news on this testing ? I'd like to have these upstream
for rc3.
Thanks
Liam
--
Freelance Developer, SlimLogic Ltd
ASoC and Voltage Regulator Maintainer.
http://www.slimlogic.co.uk
^ permalink raw reply [flat|nested] 9+ messages in thread
* RE: [PATCH 2/2] regulator: tps6586x-regulator - fix bit_mask parameter for tps6586x_set_bits()
2010-08-26 21:25 ` Gary King
@ 2010-08-27 13:03 ` Liam Girdwood
0 siblings, 0 replies; 9+ messages in thread
From: Liam Girdwood @ 2010-08-27 13:03 UTC (permalink / raw)
To: Gary King; +Cc: Mike Rapoport, Mark Brown, Axel Lin, linux-kernel
On Thu, 2010-08-26 at 14:25 -0700, Gary King wrote:
> The patch seems fine.
>
> - Gary
> ________________________________________
> From: Liam Girdwood [lrg@slimlogic.co.uk]
> Sent: Wednesday, August 25, 2010 2:53 AM
> To: Mike Rapoport
> Cc: Mark Brown; Gary King; Axel Lin; linux-kernel
> Subject: Re: [PATCH 2/2] regulator: tps6586x-regulator - fix bit_mask parameter for tps6586x_set_bits()
>
> On Mon, 2010-08-23 at 13:09 +0300, Mike Rapoport wrote:
> > Mark Brown wrote:
> > > On Sun, Aug 22, 2010 at 10:42:42PM +0800, Axel Lin wrote:
> > >> The third parameter of tps6586x_set_bits() is the bit_mask,
> > >> thus we should use (1 << ri->go_bit) instead of ri->go_bit.
> > >>
> > >> Signed-off-by: Axel Lin <axel.lin@gmail.com>
> > >
> > > Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
> > >
> > > but I'd be much happier if someone who actually has the hardware could
> > > verify that this is OK.
> >
> > I don't have the hardware handy at the moment.
> > Gary, can you please verify the fix?
> >
>
> Do we have any news on this testing ? I'd like to have these upstream
> for rc3.
>
Applied.
Thanks
Liam
--
Freelance Developer, SlimLogic Ltd
ASoC and Voltage Regulator Maintainer.
http://www.slimlogic.co.uk
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2010-08-27 13:03 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-22 14:38 [PATCH 1/2] regulator: tps6586x-regulator - fix value range checking for val Axel Lin
2010-08-22 14:42 ` [PATCH 2/2] regulator: tps6586x-regulator - fix bit_mask parameter for tps6586x_set_bits() Axel Lin
2010-08-23 10:02 ` Mark Brown
2010-08-23 10:09 ` Mike Rapoport
2010-08-25 9:53 ` Liam Girdwood
2010-08-25 15:58 ` Gary King
2010-08-26 21:25 ` Gary King
2010-08-27 13:03 ` Liam Girdwood
2010-08-23 10:01 ` [PATCH 1/2] regulator: tps6586x-regulator - fix value range checking for val Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox