summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--util/cbfstool/cbfs_image.c2
-rw-r--r--util/cbfstool/common.c4
-rw-r--r--util/cbfstool/common.h7
-rw-r--r--util/cbfstool/rmodule.c2
4 files changed, 5 insertions, 10 deletions
diff --git a/util/cbfstool/cbfs_image.c b/util/cbfstool/cbfs_image.c
index 6ed26743cd..0e20c8057c 100644
--- a/util/cbfstool/cbfs_image.c
+++ b/util/cbfstool/cbfs_image.c
@@ -1251,7 +1251,7 @@ int cbfs_print_directory(struct cbfs_image *image)
int cbfs_print_parseable_directory(struct cbfs_image *image)
{
- int i;
+ size_t i;
const char *header[] = {
"Name",
"Offset",
diff --git a/util/cbfstool/common.c b/util/cbfstool/common.c
index bbb6141fe9..3093ba1465 100644
--- a/util/cbfstool/common.c
+++ b/util/cbfstool/common.c
@@ -139,7 +139,7 @@ static struct {
uint32_t string_to_arch(const char *arch_string)
{
- int i;
+ size_t i;
uint32_t ret = CBFS_ARCHITECTURE_UNKNOWN;
for (i = 0; i < ARRAY_SIZE(arch_names); i++) {
@@ -154,7 +154,7 @@ uint32_t string_to_arch(const char *arch_string)
const char *arch_to_string(uint32_t a)
{
- int i;
+ size_t i;
const char *ret = NULL;
for (i = 0; i < ARRAY_SIZE(arch_names); i++) {
diff --git a/util/cbfstool/common.h b/util/cbfstool/common.h
index ea6f3cf06c..d4b7021428 100644
--- a/util/cbfstool/common.h
+++ b/util/cbfstool/common.h
@@ -22,17 +22,12 @@
#include <string.h>
#include <assert.h>
+#include <commonlib/helpers.h>
#include <console/console.h>
/* Endianess */
#include "swab.h"
-/* Helpers */
-#define ARRAY_SIZE(a) (int)(sizeof(a) / sizeof((a)[0]))
-#define ALIGN(val, by) (((val) + (by)-1)&~((by)-1))
-#define MAX(x, y) ((x) > (y) ? (x) : (y))
-#define MIN(x, y) ((x) < (y) ? (x) : (y))
-
#define IS_TOP_ALIGNED_ADDRESS(x) ((uint32_t)(x) > 0x80000000)
#define unused __attribute__((unused))
diff --git a/util/cbfstool/rmodule.c b/util/cbfstool/rmodule.c
index da34eb5e07..07957cb474 100644
--- a/util/cbfstool/rmodule.c
+++ b/util/cbfstool/rmodule.c
@@ -595,7 +595,7 @@ out:
int rmodule_init(struct rmod_context *ctx, const struct buffer *elfin)
{
struct parsed_elf *pelf;
- int i;
+ size_t i;
int ret;
ret = -1;