mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Csókás Bence" <csokas.bence@prolan.hu>
To: Kees Bakker <kees@ijzerbout.nl>, <linux-pm@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>
Cc: Samuel Holland <samuel@sholland.org>, Sebastian Reichel <sre@kernel.org>
Subject: Re: [PATCH v5 3/8] power: ip5xxx_power: Allow for more parameters to be configured
Date: Sun, 8 Dec 2024 14:00:52 +0100	[thread overview]
Message-ID: <f042fea0-3977-40cb-a3b1-129ceee5b3bd@prolan.hu> (raw)
In-Reply-To: <b547c228-df70-4137-9e96-175923f62404@ijzerbout.nl>

Hi,

On 2024. 12. 06. 20:51, Kees Bakker wrote:
> Op 19-11-2024 om 19:07 schreef Csókás, Bence:
>> Other parts such as IP5306 may support other battery voltages and
>> have different constants for input voltage regulation. Allow these
>> to be passed from `struct ip5xxx_regfield_config`.
>>
>> Signed-off-by: Csókás, Bence <csokas.bence@prolan.hu>
>> ---
>>   drivers/power/supply/ip5xxx_power.c | 43 ++++++++++++++++++++++++++---
>>   1 file changed, 39 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/power/supply/ip5xxx_power.c 
>> b/drivers/power/supply/ip5xxx_power.c
>> index 41d91504eb32..a939dbfe8d23 100644
>> --- a/drivers/power/supply/ip5xxx_power.c
>> +++ b/drivers/power/supply/ip5xxx_power.c
>> [...]
>>   /*
>> @@ -328,6 +348,9 @@ static int ip5xxx_battery_get_voltage_max(struct 
>> ip5xxx *ip5xxx, int *val)
>>       if (ret)
>>           return ret;
>> +    if (*val > ip5xxx->vbat_max)
>> +        return -EINVAL;
> This is introducing the read of an uninitialized variable.
> You have to check all the callers of ip5xxx_battery_get_voltage_max()
> and what variable *val is pointing to. For example in
> ip5xxx_battery_get_property() the variable vmax is not initialized,
> while its address is passed to ip5xxx_battery_get_voltage_max()
> 
> But maybe the intention was to check rval instead of *val?
> [...]

That was supposed to go in set_voltage_max()... I'll send a fix shortly.

Bence


  reply	other threads:[~2024-12-08 13:00 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-19 18:07 [PATCH v5 1/8] power: ip5xxx_power: Use regmap_field API Csókás, Bence
2024-11-19 18:07 ` [PATCH v5 2/8] power: ip5xxx_power: Fix return value on ADC read errors Csókás, Bence
2024-12-05 11:00   ` Sebastian Reichel
2024-11-19 18:07 ` [PATCH v5 3/8] power: ip5xxx_power: Allow for more parameters to be configured Csókás, Bence
2024-12-06 19:51   ` Kees Bakker
2024-12-08 13:00     ` Csókás Bence [this message]
2024-11-19 18:07 ` [PATCH v5 4/8] power: ip5xxx_power: Add battery type for 4.4V Csókás, Bence
2024-11-19 18:07 ` [PATCH v5 5/8] power: ip5xxx_power: Check for optional bits Csókás, Bence
2024-12-05 11:01   ` Sebastian Reichel
2024-11-19 18:07 ` [PATCH v5 6/8] power: ip5xxx_power: Fall back to Charge End bit if status register is absent Csókás, Bence
2024-11-19 18:07 ` [PATCH v5 7/8] dt-bindings: trivial-devices: Add Injoinic IP5306 Csókás, Bence
2024-11-19 18:07 ` [PATCH v5 8/8] power: ip5xxx_power: Add support for IP5306 Csókás, Bence
2024-12-05  1:36 ` (subset) [PATCH v5 1/8] power: ip5xxx_power: Use regmap_field API Sebastian Reichel
2024-12-05 11:02   ` Sebastian Reichel

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=f042fea0-3977-40cb-a3b1-129ceee5b3bd@prolan.hu \
    --to=csokas.bence@prolan.hu \
    --cc=kees@ijzerbout.nl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=samuel@sholland.org \
    --cc=sre@kernel.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

all inboxes | Powered by JetHome®