[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9859023c-57bf-4316-911c-c5f5ade1ebb4@foss.st.com>
Date: Mon, 26 Feb 2024 09:25:02 +0100
From: Christophe Kerello <christophe.kerello@...s.st.com>
To: Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>, <robh+dt@...nel.org>,
<krzysztof.kozlowski+dt@...aro.org>, <conor+dt@...nel.org>
CC: <linux-kernel@...r.kernel.org>, <linux-stm32@...md-mailman.stormreply.com>,
<devicetree@...r.kernel.org>
Subject: Re: [PATCH v2 2/5] memory: stm32-fmc2-ebi: check regmap_read return
value
Hi Krzysztof,
On 2/21/24 09:29, Krzysztof Kozlowski wrote:
> On 19/02/2024 15:01, Christophe Kerello wrote:
>> Check regmap_read return value to avoid to use uninitialized local
>> variables.
>>
>> Signed-off-by: Christophe Kerello <christophe.kerello@...s.st.com>
>> ---
>> Changes in v2:
>> - New patch added
>>
>> drivers/memory/stm32-fmc2-ebi.c | 128 +++++++++++++++++++++++---------
>> 1 file changed, 94 insertions(+), 34 deletions(-)
>>
>
> ...
>
>> -static void stm32_fmc2_ebi_save_setup(struct stm32_fmc2_ebi *ebi)
>> +static int stm32_fmc2_ebi_save_setup(struct stm32_fmc2_ebi *ebi)
>> {
>> unsigned int cs;
>> + int ret;
>>
>> for (cs = 0; cs < FMC2_MAX_EBI_CE; cs++) {
>> - regmap_read(ebi->regmap, FMC2_BCR(cs), &ebi->bcr[cs]);
>> - regmap_read(ebi->regmap, FMC2_BTR(cs), &ebi->btr[cs]);
>> - regmap_read(ebi->regmap, FMC2_BWTR(cs), &ebi->bwtr[cs]);
>> + ret = regmap_read(ebi->regmap, FMC2_BCR(cs), &ebi->bcr[cs]);
>> + if (ret)
>> + return ret;
>> +
>> + ret = regmap_read(ebi->regmap, FMC2_BTR(cs), &ebi->btr[cs]);
>> + if (ret)
>> + return ret;
>> +
>> + ret = regmap_read(ebi->regmap, FMC2_BWTR(cs), &ebi->bwtr[cs]);
>> + if (ret)
>> + return ret;
>
> These are just:
>
> ret |= regmapr_read()
> and one "if (ret)" clause.
>
Ok, it will be done in V3.
Regards,
Christophe Kerello.
>
>
> Best regards,
> Krzysztof
>
Powered by blists - more mailing lists