summaryrefslogtreecommitdiff
path: root/ubi-utils/ubiformat.c
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2016-09-01 15:27:38 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2016-11-17 11:36:56 +0100
commitf4ec4511d0729802e783b1757d6bcd556737510e (patch)
treede44ef5941b606e5ad5ac86ee4eba37013c8c863 /ubi-utils/ubiformat.c
parentdbb13d2f0eba1770a96cac537218e7625556e172 (diff)
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 <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'ubi-utils/ubiformat.c')
-rw-r--r--ubi-utils/ubiformat.c11
1 files changed, 5 insertions, 6 deletions
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 <mtd_swab.h>
#include <crc32.h>
#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);
}