From f4ec4511d0729802e783b1757d6bcd556737510e Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Thu, 1 Sep 2016 15:27:38 +0200 Subject: Merge rest of ubiutils-common into libmtd common This patch moves the remaining 3 functions from ubiutils-common.{c,h} into libmtd common.{c,h}. The functions are only generic utility functions that other mtd-utils programs may also find usefull and every program that uses libubi links against libmtd anyway so there is no real reason for keeping around a seperate ubiutils-common with only generic helper functions. Signed-off-by: David Oberhollenzer --- ubi-utils/ubinize.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'ubi-utils/ubinize.c') diff --git a/ubi-utils/ubinize.c b/ubi-utils/ubinize.c index b5ebadc..c85ff9b 100644 --- a/ubi-utils/ubinize.c +++ b/ubi-utils/ubinize.c @@ -37,7 +37,6 @@ #include #include #include "common.h" -#include "ubiutils-common.h" static const char optionsstr[] = "-o, --output= output file name\n" @@ -110,7 +109,7 @@ static struct args args = { static int parse_opt(int argc, char * const argv[]) { - ubiutils_srand(); + util_srand(); args.image_seq = rand(); while (1) { @@ -131,13 +130,13 @@ static int parse_opt(int argc, char * const argv[]) break; case 'p': - args.peb_size = ubiutils_get_bytes(optarg); + args.peb_size = util_get_bytes(optarg); if (args.peb_size <= 0) return errmsg("bad physical eraseblock size: \"%s\"", optarg); break; case 'm': - args.min_io_size = ubiutils_get_bytes(optarg); + args.min_io_size = util_get_bytes(optarg); if (args.min_io_size <= 0) return errmsg("bad min. I/O unit size: \"%s\"", optarg); if (!is_power_of_2(args.min_io_size)) @@ -145,7 +144,7 @@ static int parse_opt(int argc, char * const argv[]) break; case 's': - args.subpage_size = ubiutils_get_bytes(optarg); + args.subpage_size = util_get_bytes(optarg); if (args.subpage_size <= 0) return errmsg("bad sub-page size: \"%s\"", optarg); if (!is_power_of_2(args.subpage_size)) @@ -324,7 +323,7 @@ static int read_section(const struct ubigen_info *ui, const char *sname, sprintf(buf, "%s:vol_size", sname); p = iniparser_getstring(args.dict, buf, NULL); if (p) { - vi->bytes = ubiutils_get_bytes(p); + vi->bytes = util_get_bytes(p); if (vi->bytes <= 0) return errmsg("bad \"vol_size\" key value \"%s\" (section \"%s\")", p, sname); @@ -353,7 +352,7 @@ static int read_section(const struct ubigen_info *ui, const char *sname, normsg_cont("volume size was not specified in section \"%s\", assume" " minimum to fit image \"%s\"", sname, *img); - ubiutils_print_bytes(vi->bytes, 1); + util_print_bytes(vi->bytes, 1); printf("\n"); } -- cgit v1.2.3