From: Mark Kettenis Date: Wed, 24 Feb 2021 15:14:59 +0100 (CET) Subject: [PATCH] image: Avoid -ENODATA in host tools In-Reply-To: <20210224084950.1.I6e96684b5ef6b9a87109ed551df011d1e7ecdecb@changeid> (message from Simon Glass on Wed, 24 Feb 2021 08:50:32 -0500) References: <20210224084950.1.I6e96684b5ef6b9a87109ed551df011d1e7ecdecb@changeid> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de > From: Simon Glass > Date: Wed, 24 Feb 2021 08:50:32 -0500 > > 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() > Signed-off-by: Simon Glass > --- > > common/image-fit.c | 2 +- > include/image.h | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) Thanks, that works! Reviewed-by: Mark Kettenis > diff --git a/common/image-fit.c b/common/image-fit.c > index 28b3d2b1911..94501b10716 100644 > --- a/common/image-fit.c > +++ b/common/image-fit.c > @@ -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; > } > } > > diff --git a/include/image.h b/include/image.h > index 138c83dd28d..b4b284d52b7 100644 > --- a/include/image.h > +++ b/include/image.h > @@ -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); > -- > 2.30.0.617.g56c4b15f3c-goog > >