Skip to contentSkip to conversation

image: Avoid -ENODATA in host tools

PATCH New Simon Glass 3 participants 3 messages Feb 24, 2021 – Mar 18, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 image: Avoid -ENODATA in host tools

Unfortunately -ENODATA is not available in OpenBSD. Use -EBADMSG instead, to indicate a missing timestamp.

Fixes c5819701a3d image: Adjust the workings of fit_check_format()

---

 common/image-fit.c | 2 +-
 include/image.h    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
common/image-fit.c +1 -1
index 28b3d2b1911..94501b10716 100644
@@ -1651,7 +1651,7 @@ int fit_check_format(const void *fit, ulong size)
 		/* mandatory / node 'timestamp' property */
 		if (!fdt_getprop(fit, 0, FIT_TIMESTAMP_PROP, NULL)) {
 			log_debug("Wrong FIT format: no timestamp\n");
-			return -ENODATA;
+			return -EBADMSG;
 		}
 	}
 
include/image.h +1 -1
index 138c83dd28d..b4b284d52b7 100644
@@ -1158,7 +1158,7 @@ int fit_image_check_comp(const void *fit, int noffset, uint8_t comp);
  * @fit: pointer to the FIT format image header
  * @return 0 if OK, -ENOEXEC if not an FDT file, -EINVAL if the full FDT check
  *	failed (e.g. due to bad structure), -ENOMSG if the description is
- *	missing, -ENODATA if the timestamp is missing, -ENOENT if the /images
+ *	missing, -EBADMSG if the timestamp is missing, -ENOENT if the /images
  *	path is missing
  */
 int fit_check_format(const void *fit, ulong size);
Signature · 1 line
2.30.0.617.g56c4b15f3c-goog
#1 lore raw

PATCH 1/1 image: Avoid -ENODATA in host tools

Quoted 6 lines

From: Simon Glass <[email protected]>
Date: Wed, 24 Feb 2021 08:50:32 -0500

Unfortunately -ENODATA is not available in OpenBSD. Use -EBADMSG instead, to indicate a missing timestamp.

Quoted 7 lines
Fixes c5819701a3d image: Adjust the workings of fit_check_format()

---

 common/image-fit.c | 2 +-
 include/image.h    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Thanks, that works!

Quoted 30 lines
common/image-fit.c +1 -1
index 28b3d2b1911..94501b10716 100644
@@ -1651,7 +1651,7 @@ int fit_check_format(const void *fit, ulong size)
 		/* mandatory / node 'timestamp' property */
 		if (!fdt_getprop(fit, 0, FIT_TIMESTAMP_PROP, NULL)) {
 			log_debug("Wrong FIT format: no timestamp\n");
-			return -ENODATA;
+			return -EBADMSG;
 		}
 	}
 
include/image.h +1 -1
index 138c83dd28d..b4b284d52b7 100644
@@ -1158,7 +1158,7 @@ int fit_image_check_comp(const void *fit, int noffset, uint8_t comp);
  * @fit: pointer to the FIT format image header
  * @return 0 if OK, -ENOEXEC if not an FDT file, -EINVAL if the full FDT check
  *	failed (e.g. due to bad structure), -ENOMSG if the description is
- *	missing, -ENODATA if the timestamp is missing, -ENOENT if the /images
+ *	missing, -EBADMSG if the timestamp is missing, -ENOENT if the /images
  *	path is missing
  */
 int fit_check_format(const void *fit, ulong size);
Signature · 1 line
2.30.0.617.g56c4b15f3c-goog
#2 lore raw

PATCH 1/1 image: Avoid -ENODATA in host tools

In reply to Simon Glass
Quoted 6 lines · Simon Glass

Unfortunately -ENODATA is not available in OpenBSD. Use -EBADMSG instead, to indicate a missing timestamp.

Fixes c5819701a3d image: Adjust the workings of fit_check_format()

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210318/667756fc/attachment.sig>