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/ubiformat.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'ubi-utils/ubiformat.c') diff --git a/ubi-utils/ubiformat.c b/ubi-utils/ubiformat.c index 21409ca..68906f2 100644 --- a/ubi-utils/ubiformat.c +++ b/ubi-utils/ubiformat.c @@ -45,7 +45,6 @@ #include #include #include "common.h" -#include "ubiutils-common.h" /* The variables below are set by command line arguments */ struct args { @@ -130,7 +129,7 @@ static const struct option long_options[] = { static int parse_opt(int argc, char * const argv[]) { - ubiutils_srand(); + util_srand(); args.image_seq = rand(); while (1) { @@ -143,7 +142,7 @@ static int parse_opt(int argc, char * const argv[]) switch (key) { 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)) @@ -170,7 +169,7 @@ static int parse_opt(int argc, char * const argv[]) break; case 'S': - args.image_sz = ubiutils_get_bytes(optarg); + args.image_sz = util_get_bytes(optarg); if (args.image_sz <= 0) return errmsg("bad image-size: \"%s\"", optarg); break; @@ -791,9 +790,9 @@ int main(int argc, char * const argv[]) if (!args.quiet) { normsg_cont("mtd%d (%s), size ", mtd.mtd_num, mtd.type_str); - ubiutils_print_bytes(mtd.size, 1); + util_print_bytes(mtd.size, 1); printf(", %d eraseblocks of ", mtd.eb_cnt); - ubiutils_print_bytes(mtd.eb_size, 1); + util_print_bytes(mtd.eb_size, 1); printf(", min. I/O size %d bytes\n", mtd.min_io_size); } -- cgit v1.2.3