Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1552417 > unrolled thread
| Started by | Sebastian Reichel <sre@kernel.org> |
|---|---|
| First post | 2017-01-06 01:10 +0100 |
| Last post | 2017-01-06 18:40 +0100 |
| Articles | 3 — 2 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.
Re: [PATCH v2 01/11] power: supplies: bq275xx: rename BQ27500 allow for deprecation in future. Sebastian Reichel <sre@kernel.org> - 2017-01-06 01:10 +0100
Re: [PATCH v2 01/11] power: supplies: bq275xx: rename BQ27500 allow for deprecation in future. Chris Lapa <chris@lapa.com.au> - 2017-01-06 01:30 +0100
Re: [PATCH v2 01/11] power: supplies: bq275xx: rename BQ27500 allow for deprecation in future. Sebastian Reichel <sre@kernel.org> - 2017-01-06 18:40 +0100
| From | Sebastian Reichel <sre@kernel.org> |
|---|---|
| Date | 2017-01-06 01:10 +0100 |
| Subject | Re: [PATCH v2 01/11] power: supplies: bq275xx: rename BQ27500 allow for deprecation in future. |
| Message-ID | <sWqgy-217-21@gated-at.bofh.it> |
[Multipart message — attachments visible in raw view] — view raw
Hi Chris,
On Fri, Dec 23, 2016 at 11:04:57AM +1100, Chris Lapa wrote:
> From: Chris Lapa <chris@lapa.com.au>
>
> The BQ275XX definition exists only to satisfy backwards compatibility.
>
> tested: yes
>
> Signed-off-by: Chris Lapa <chris@lapa.com.au>
>
> [...]
>
> static bool bq27xxx_battery_overtemp(struct bq27xxx_device_info *di, u16 flags)
> {
> - if (di->chip == BQ27500 || di->chip == BQ27541 || di->chip == BQ27545)
> + if (di->chip == BQ275XX || di->chip == BQ27541 || di->chip == BQ27545)
> return flags & (BQ27XXX_FLAG_OTC | BQ27XXX_FLAG_OTD);
> if (di->chip == BQ27530 || di->chip == BQ27421)
> return flags & BQ27XXX_FLAG_OT;
This is really getting out of hands in this patchset. Please
add a patch at the beginning of the patchset, which converts
this construct into the following:
switch (di->chip) {
case A:
case B:
case C:
case D:
return flags & (BQ27XXX_FLAG_OTC | BQ27XXX_FLAG_OTD);
case E:
case F:
return flags & BQ27XXX_FLAG_OT;
default:
return false;
}
-- Sebastian
[toc] | [next] | [standalone]
| From | Chris Lapa <chris@lapa.com.au> |
|---|---|
| Date | 2017-01-06 01:30 +0100 |
| Message-ID | <sWqzU-29g-15@gated-at.bofh.it> |
| In reply to | #1552417 |
On 6/1/17 10:59 am, Sebastian Reichel wrote:
> Hi Chris,
>
> On Fri, Dec 23, 2016 at 11:04:57AM +1100, Chris Lapa wrote:
>> From: Chris Lapa <chris@lapa.com.au>
>>
>> The BQ275XX definition exists only to satisfy backwards compatibility.
>>
>> tested: yes
>>
>> Signed-off-by: Chris Lapa <chris@lapa.com.au>
>>
>> [...]
>>
>> static bool bq27xxx_battery_overtemp(struct bq27xxx_device_info *di, u16 flags)
>> {
>> - if (di->chip == BQ27500 || di->chip == BQ27541 || di->chip == BQ27545)
>> + if (di->chip == BQ275XX || di->chip == BQ27541 || di->chip == BQ27545)
>> return flags & (BQ27XXX_FLAG_OTC | BQ27XXX_FLAG_OTD);
>> if (di->chip == BQ27530 || di->chip == BQ27421)
>> return flags & BQ27XXX_FLAG_OT;
>
> This is really getting out of hands in this patchset. Please
> add a patch at the beginning of the patchset, which converts
> this construct into the following:
>
> switch (di->chip) {
> case A:
> case B:
> case C:
> case D:
> return flags & (BQ27XXX_FLAG_OTC | BQ27XXX_FLAG_OTD);
> case E:
> case F:
> return flags & BQ27XXX_FLAG_OT;
> default:
> return false;
> }
>
> -- Sebastian
>
I was advised to move these tests into a function which I've done in the
10th patch. I have no issue with changing it to a switch statement, but
should I drop the bq27xxx_has_multiple_overtemp_flags() function I added?
[toc] | [prev] | [next] | [standalone]
| From | Sebastian Reichel <sre@kernel.org> |
|---|---|
| Date | 2017-01-06 18:40 +0100 |
| Message-ID | <sWGEF-59N-1@gated-at.bofh.it> |
| In reply to | #1552425 |
[Multipart message — attachments visible in raw view] — view raw
Hi,
On Fri, Jan 06, 2017 at 11:29:19AM +1100, Chris Lapa wrote:
> On 6/1/17 10:59 am, Sebastian Reichel wrote:
> > Hi Chris,
> >
> > On Fri, Dec 23, 2016 at 11:04:57AM +1100, Chris Lapa wrote:
> > > From: Chris Lapa <chris@lapa.com.au>
> > >
> > > The BQ275XX definition exists only to satisfy backwards compatibility.
> > >
> > > tested: yes
> > >
> > > Signed-off-by: Chris Lapa <chris@lapa.com.au>
> > >
> > > [...]
> > >
> > > static bool bq27xxx_battery_overtemp(struct bq27xxx_device_info *di, u16 flags)
> > > {
> > > - if (di->chip == BQ27500 || di->chip == BQ27541 || di->chip == BQ27545)
> > > + if (di->chip == BQ275XX || di->chip == BQ27541 || di->chip == BQ27545)
> > > return flags & (BQ27XXX_FLAG_OTC | BQ27XXX_FLAG_OTD);
> > > if (di->chip == BQ27530 || di->chip == BQ27421)
> > > return flags & BQ27XXX_FLAG_OT;
> >
> > This is really getting out of hands in this patchset. Please
> > add a patch at the beginning of the patchset, which converts
> > this construct into the following:
> >
> > switch (di->chip) {
> > case A:
> > case B:
> > case C:
> > case D:
> > return flags & (BQ27XXX_FLAG_OTC | BQ27XXX_FLAG_OTD);
> > case E:
> > case F:
> > return flags & BQ27XXX_FLAG_OT;
> > default:
> > return false;
> > }
> >
> > -- Sebastian
> >
>
> I was advised to move these tests into a function which I've done in the
> 10th patch. I have no issue with changing it to a switch statement, but
> should I drop the bq27xxx_has_multiple_overtemp_flags() function I added?
I'm fine with or without the extra function. But please introduce
the switch at the beginning of the patchseries, since it also eases
patch-reviewing.
-- Sebastian
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web