From: Ivan Vecera <ivecera@redhat.com>
To: Simon Horman <horms@kernel.org>
Cc: netdev@vger.kernel.org, Jiri Pirko <jiri@resnulli.us>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Jonathan Corbet <corbet@lwn.net>,
Prathosh Satish <Prathosh.Satish@microchip.com>,
linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
Michal Schmidt <mschmidt@redhat.com>,
Petr Oros <poros@redhat.com>
Subject: Re: [PATCH net-next 3/5] dpll: zl3073x: Add firmware loading functionality
Date: Tue, 29 Jul 2025 17:20:10 +0200 [thread overview]
Message-ID: <5f2aaa88-d3fb-46ae-b325-603fda5e8851@redhat.com> (raw)
In-Reply-To: <20250726203351.GP1367887@horms.kernel.org>
On 26. 07. 25 10:33 odp., Simon Horman wrote:
> On Fri, Jul 25, 2025 at 05:41:34PM +0200, Ivan Vecera wrote:
>> Add functionality for loading firmware files provided by the vendor
>> to be flashed into the device's internal flash memory. The firmware
>> consists of several components, such as the firmware executable itself,
>> chip-specific customizations, and configuration files.
>>
>> The firmware file contains at least a flash utility, which is executed
>> on the device side, and one or more flashable components. Each component
>> has its own specific properties, such as the address where it should be
>> loaded during flashing, one or more destination flash pages, and
>> the flashing method that should be used.
>>
>> Signed-off-by: Ivan Vecera <ivecera@redhat.com>
>
> Hi Ivan,
>
> Some minor feedback from my side.
>
> ...
>
>> diff --git a/drivers/dpll/zl3073x/fw.c b/drivers/dpll/zl3073x/fw.c
>
> ...
Hi Simon,
>
>> +/* Santity check */
>
> Sanity
Will fix in v2.
>> +static_assert(ARRAY_SIZE(component_info) == ZL_FW_NUM_COMPONENTS);
>
> ...
>
>> +int zl3073x_fw_flash(struct zl3073x_dev *zldev, struct zl3073x_fw *zlfw,
>> + struct netlink_ext_ack *extack)
>> +{
>> + int i, rc;
>> +
>> + for (i = 0; i < ZL_FW_NUM_COMPONENTS; i++) {
>> + if (!zlfw->component[i])
>> + continue; /* Component is not present */
>> +
>> + rc = zl3073x_fw_component_flash(zldev, zlfw->component[i],
>> + extack);
>> + if (rc)
>> + break;
>> + }
>
> Perhaps it cannot happen in practice.
> But Smatch warns that rc may be used uninitialised below.
> And that does seem theoretically possible if all
> iterations of the loop above hit the "continue" path.
Yes, it should not happen as at least one component has to be present
but for sure I will init rc in the next iteration.
Thanks for review,
Ivan
>
>> +
>> + return rc;
>> +}
>
> ...
>
next prev parent reply other threads:[~2025-07-29 15:20 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-25 15:41 [PATCH net-next 0/5] dpll: zl3073x: Add support for devlink flash Ivan Vecera
2025-07-25 15:41 ` [PATCH net-next 1/5] dpll: zl3073x: Add functions to access hardware registers Ivan Vecera
2025-07-25 15:41 ` [PATCH net-next 2/5] dpll: zl3073x: Add low-level flash functions Ivan Vecera
2025-07-26 10:36 ` kernel test robot
2025-07-25 15:41 ` [PATCH net-next 3/5] dpll: zl3073x: Add firmware loading functionality Ivan Vecera
2025-07-26 20:33 ` Simon Horman
2025-07-29 15:20 ` Ivan Vecera [this message]
2025-07-25 15:41 ` [PATCH net-next 4/5] dpll: zl3073x: Refactor DPLL initialization Ivan Vecera
2025-07-26 10:57 ` kernel test robot
2025-07-25 15:41 ` [PATCH net-next 5/5] dpll: zl3073x: Implement devlink flash callback Ivan Vecera
2025-07-25 17:18 ` [PATCH net-next 0/5] dpll: zl3073x: Add support for devlink flash Ivan Vecera
2025-07-25 17:42 ` Jakub Kicinski
2025-07-25 17:59 ` Ivan Vecera
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=5f2aaa88-d3fb-46ae-b325-603fda5e8851@redhat.com \
--to=ivecera@redhat.com \
--cc=Prathosh.Satish@microchip.com \
--cc=corbet@lwn.net \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=jiri@resnulli.us \
--cc=kuba@kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mschmidt@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=poros@redhat.com \
/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®