diff mbox series

[2/4] image: fit: Improve functions description comments

Message ID 20230916082344.583308-1-massimo.pegorer+oss@gmail.com
State Changes Requested
Delegated to: Tom Rini
Headers show
Series spl: atf: Fix potential bug on getting FIT data | expand

Commit Message

Massimo Pegorer Sept. 16, 2023, 8:23 a.m. UTC
Load and entry addresses are returned in ulong variables, which are
32 or 64 bit depending on architecture. Specify that on failure these
functions do not set memory pointed by load / entry argument: this
detail is relavant for correct functions usage.

Signed-off-by: Massimo Pegorer <massimo.pegorer+oss@gmail.com>
---
 boot/image-fit.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

Comments

Simon Glass Sept. 21, 2023, 1:02 a.m. UTC | #1
On Sat, 16 Sept 2023 at 02:23, Massimo Pegorer
<massimo.pegorer+oss@gmail.com> wrote:
>
> Load and entry addresses are returned in ulong variables, which are
> 32 or 64 bit depending on architecture. Specify that on failure these
> functions do not set memory pointed by load / entry argument: this
> detail is relavant for correct functions usage.
>
> Signed-off-by: Massimo Pegorer <massimo.pegorer+oss@gmail.com>
> ---
>  boot/image-fit.c | 12 +++++-------
>  1 file changed, 5 insertions(+), 7 deletions(-)
>

Reviewed-by: Simon Glass <sjg@chromium.org>
diff mbox series

Patch

diff --git a/boot/image-fit.c b/boot/image-fit.c
index 3cc556b727..7e87a513e7 100644
--- a/boot/image-fit.c
+++ b/boot/image-fit.c
@@ -869,10 +869,11 @@  static int fit_image_get_address(const void *fit, int noffset, char *name,
  * fit_image_get_load() - get load addr property for given component image node
  * @fit: pointer to the FIT format image header
  * @noffset: component image node offset
- * @load: pointer to the uint32_t, will hold load address
+ * @load: pointer to ulong, will hold load address
  *
  * fit_image_get_load() finds load address property in a given component
  * image node. If the property is found, its value is returned to the caller.
+ * Otherwise, on failure, *load will be left untouched.
  *
  * returns:
  *     0, on success
@@ -887,14 +888,11 @@  int fit_image_get_load(const void *fit, int noffset, ulong *load)
  * fit_image_get_entry() - get entry point address property
  * @fit: pointer to the FIT format image header
  * @noffset: component image node offset
- * @entry: pointer to the uint32_t, will hold entry point address
- *
- * This gets the entry point address property for a given component image
- * node.
+ * @entry: pointer to ulong, will hold entry point address
  *
  * fit_image_get_entry() finds entry point address property in a given
- * component image node.  If the property is found, its value is returned
- * to the caller.
+ * component image node. If the property is found, its value is returned
+ * to the caller. Otherwise, on failure, *entry will be left untouched.
  *
  * returns:
  *     0, on success