Elyes Haouas has submitted this change. ( https://review.coreboot.org/c/coreboot/+/85786?usp=email )
(
4 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. )Change subject: util/cbfstool: Refine type and signatures ......................................................................
util/cbfstool: Refine type and signatures
As suggested by the linter:
Prefer 'unsigned long' over 'unsigned long int' as the int is unnecessary
In fmap_bsearch(), removed needless assignment of offset; it is already set to 0 in the search loop.
fmap_find() uses the return value of fmap_bsearch(); and is declared as 'long int'. Per the linter warnings, replaced 'long int' by 'long'.
Prefer 'long' over 'long int' as the int is unnecessary
Link: https://qa.coreboot.org/job/coreboot-untested-files/lastSuccessfulBuild/arti... Change-Id: If94e70778d0302552f151c31d3073524162faf9e Signed-off-by: Ariel Otilibili otilibil@eurecom.fr Reviewed-on: https://review.coreboot.org/c/coreboot/+/85786 Reviewed-by: Felix Singer service+coreboot-gerrit@felixsinger.de Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Elyes Haouas ehaouas@noos.fr --- M util/cbfstool/cbfstool.c M util/cbfstool/flashmap/fmap.c 2 files changed, 9 insertions(+), 9 deletions(-)
Approvals: build bot (Jenkins): Verified Felix Singer: Looks good to me, approved Elyes Haouas: Looks good to me, approved
diff --git a/util/cbfstool/cbfstool.c b/util/cbfstool/cbfstool.c index 5eb6335..3ba6bcd 100644 --- a/util/cbfstool/cbfstool.c +++ b/util/cbfstool/cbfstool.c @@ -352,11 +352,11 @@ return 1;
union { - unsigned long int array[3]; + unsigned long array[3]; struct { - unsigned long int flash_base; - unsigned long int mmap_base; - unsigned long int mmap_size; + unsigned long flash_base; + unsigned long mmap_base; + unsigned long mmap_size; }; } mmap_args; char *suffix = NULL; diff --git a/util/cbfstool/flashmap/fmap.c b/util/cbfstool/flashmap/fmap.c index 46c31bb..e806491 100644 --- a/util/cbfstool/flashmap/fmap.c +++ b/util/cbfstool/flashmap/fmap.c @@ -74,7 +74,7 @@ /* brute force linear search */ static long int fmap_lsearch(const uint8_t *image, size_t len) { - unsigned long int offset; + unsigned long offset; int fmap_found = 0;
for (offset = 0; offset < len - strlen(FMAP_SIGNATURE); offset++) { @@ -94,9 +94,9 @@ }
/* if image length is a power of 2, use binary search */ -static long int fmap_bsearch(const uint8_t *image, size_t len) +static long fmap_bsearch(const uint8_t *image, size_t len) { - unsigned long int offset = -1; + unsigned long offset; int fmap_found = 0, stride;
/* @@ -142,9 +142,9 @@ return count; }
-long int fmap_find(const uint8_t *image, unsigned int image_len) +long fmap_find(const uint8_t *image, unsigned int image_len) { - long int ret = -1; + long ret = -1;
if ((image == NULL) || (image_len == 0)) return -1;