From e960f7eb17f8d72f00364e9fc9f9a27b5563e318 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sun, 26 Sep 2010 14:48:51 -0400 Subject: mtd-utils: standardize PROGRAM_NAME Make sure all the utils define PROGRAM_NAME and do so at the start of the file so that sub-headers may assume it exists. Signed-off-by: Mike Frysinger Signed-off-by: Artem Bityutskiy --- ubi-utils/src/libscan.c | 4 ++-- ubi-utils/src/libubi.c | 4 ++-- ubi-utils/src/libubigen.c | 4 ++-- ubi-utils/src/mtdinfo.c | 6 +++--- ubi-utils/src/ubiattach.c | 5 +++-- ubi-utils/src/ubicrc32.c | 6 +++--- ubi-utils/src/ubidetach.c | 5 +++-- ubi-utils/src/ubiformat.c | 6 +++--- ubi-utils/src/ubimkvol.c | 6 +++--- ubi-utils/src/ubinfo.c | 6 +++--- ubi-utils/src/ubinize.c | 6 +++--- ubi-utils/src/ubirename.c | 6 +++--- ubi-utils/src/ubirmvol.c | 6 +++--- ubi-utils/src/ubirsvol.c | 6 +++--- ubi-utils/src/ubiupdatevol.c | 6 +++--- ubi-utils/src/ubiutils-common.c | 2 ++ 16 files changed, 44 insertions(+), 40 deletions(-) (limited to 'ubi-utils') diff --git a/ubi-utils/src/libscan.c b/ubi-utils/src/libscan.c index 6c6990f..dc47a89 100644 --- a/ubi-utils/src/libscan.c +++ b/ubi-utils/src/libscan.c @@ -20,6 +20,8 @@ * UBI scanning library. */ +#define PROGRAM_NAME "libscan" + #include #include #include @@ -35,8 +37,6 @@ #include #include "common.h" -#define PROGRAM_NAME "libscan" - static int all_ff(const void *buf, int len) { int i; diff --git a/ubi-utils/src/libubi.c b/ubi-utils/src/libubi.c index 2eab3ba..4d5f316 100644 --- a/ubi-utils/src/libubi.c +++ b/ubi-utils/src/libubi.c @@ -20,6 +20,8 @@ * UBI (Unsorted Block Images) library. */ +#define PROGRAM_NAME "libubi" + #include #include #include @@ -34,8 +36,6 @@ #include "libubi_int.h" #include "common.h" -#define PROGRAM_NAME "libubi" - /** * mkpath - compose full path from 2 given components. * @path: the first component diff --git a/ubi-utils/src/libubigen.c b/ubi-utils/src/libubigen.c index 710aa97..9eaa7f5 100644 --- a/ubi-utils/src/libubigen.c +++ b/ubi-utils/src/libubigen.c @@ -24,6 +24,8 @@ * Artem Bityutskiy */ +#define PROGRAM_NAME "libubigen" + #include #include #include @@ -35,8 +37,6 @@ #include #include "common.h" -#define PROGRAM_NAME "libubigen" - void ubigen_info_init(struct ubigen_info *ui, int peb_size, int min_io_size, int subpage_size, int vid_hdr_offs, int ubi_ver, uint32_t image_seq) diff --git a/ubi-utils/src/mtdinfo.c b/ubi-utils/src/mtdinfo.c index b39ed5f..a2d7547 100644 --- a/ubi-utils/src/mtdinfo.c +++ b/ubi-utils/src/mtdinfo.c @@ -21,6 +21,9 @@ * Author: Artem Bityutskiy */ +#define PROGRAM_VERSION "1.0" +#define PROGRAM_NAME "mtdinfo" + #include #include #include @@ -33,9 +36,6 @@ #include "common.h" #include "ubiutils-common.h" -#define PROGRAM_VERSION "1.0" -#define PROGRAM_NAME "mtdinfo" - /* The variables below are set by command line arguments */ struct args { int mtdn; diff --git a/ubi-utils/src/ubiattach.c b/ubi-utils/src/ubiattach.c index 5a7d2cf..51a0cfb 100644 --- a/ubi-utils/src/ubiattach.c +++ b/ubi-utils/src/ubiattach.c @@ -21,6 +21,9 @@ * Author: Artem Bityutskiy */ +#define PROGRAM_VERSION "1.1" +#define PROGRAM_NAME "ubiattach" + #include #include #include @@ -31,8 +34,6 @@ #include "common.h" #include "ubiutils-common.h" -#define PROGRAM_VERSION "1.1" -#define PROGRAM_NAME "ubiattach" #define DEFAULT_CTRL_DEV "/dev/ubi_ctrl" /* The variables below are set by command line arguments */ diff --git a/ubi-utils/src/ubicrc32.c b/ubi-utils/src/ubicrc32.c index becd604..ec10858 100644 --- a/ubi-utils/src/ubicrc32.c +++ b/ubi-utils/src/ubicrc32.c @@ -22,6 +22,9 @@ * Author: Oliver Lohmann */ +#define PROGRAM_VERSION "1.0" +#define PROGRAM_NAME "ubicrc32" + #include #include #include @@ -34,9 +37,6 @@ #define BUFSIZE 4096 -#define PROGRAM_VERSION "1.0" -#define PROGRAM_NAME "ubicrc32" - static const char *doc = PROGRAM_NAME " version " PROGRAM_VERSION " - a tool to calculate CRC32 with UBI start value (0xFFFFFFFF)"; diff --git a/ubi-utils/src/ubidetach.c b/ubi-utils/src/ubidetach.c index e0bc050..59e478b 100644 --- a/ubi-utils/src/ubidetach.c +++ b/ubi-utils/src/ubidetach.c @@ -21,6 +21,9 @@ * Author: Artem Bityutskiy */ +#define PROGRAM_VERSION "1.1" +#define PROGRAM_NAME "ubidetach" + #include #include #include @@ -30,8 +33,6 @@ #include #include "common.h" -#define PROGRAM_VERSION "1.1" -#define PROGRAM_NAME "ubidetach" #define DEFAULT_CTRL_DEV "/dev/ubi_ctrl" /* The variables below are set by command line arguments */ diff --git a/ubi-utils/src/ubiformat.c b/ubi-utils/src/ubiformat.c index 8559f61..7cea8a9 100644 --- a/ubi-utils/src/ubiformat.c +++ b/ubi-utils/src/ubiformat.c @@ -29,6 +29,9 @@ */ #define MAX_CONSECUTIVE_BAD_BLOCKS 4 +#define PROGRAM_VERSION "1.5" +#define PROGRAM_NAME "ubiformat" + #include #include #include @@ -45,9 +48,6 @@ #include "common.h" #include "ubiutils-common.h" -#define PROGRAM_VERSION "1.5" -#define PROGRAM_NAME "ubiformat" - /* The variables below are set by command line arguments */ struct args { unsigned int yes:1; diff --git a/ubi-utils/src/ubimkvol.c b/ubi-utils/src/ubimkvol.c index c867c44..cc8cd55 100644 --- a/ubi-utils/src/ubimkvol.c +++ b/ubi-utils/src/ubimkvol.c @@ -23,6 +23,9 @@ * Frank Haverkamp */ +#define PROGRAM_VERSION "1.1" +#define PROGRAM_NAME "ubimkvol" + #include #include #include @@ -33,9 +36,6 @@ #include "common.h" #include "ubiutils-common.h" -#define PROGRAM_VERSION "1.1" -#define PROGRAM_NAME "ubimkvol" - /* The variables below are set by command line arguments */ struct args { int vol_id; diff --git a/ubi-utils/src/ubinfo.c b/ubi-utils/src/ubinfo.c index cecab43..44f6fb0 100644 --- a/ubi-utils/src/ubinfo.c +++ b/ubi-utils/src/ubinfo.c @@ -21,6 +21,9 @@ * Author: Artem Bityutskiy */ +#define PROGRAM_VERSION "1.1" +#define PROGRAM_NAME "ubinfo" + #include #include #include @@ -31,9 +34,6 @@ #include "common.h" #include "ubiutils-common.h" -#define PROGRAM_VERSION "1.1" -#define PROGRAM_NAME "ubinfo" - /* The variables below are set by command line arguments */ struct args { int devn; diff --git a/ubi-utils/src/ubinize.c b/ubi-utils/src/ubinize.c index 2ff4e29..5cee5aa 100644 --- a/ubi-utils/src/ubinize.c +++ b/ubi-utils/src/ubinize.c @@ -24,6 +24,9 @@ * Oliver Lohmann */ +#define PROGRAM_VERSION "1.2" +#define PROGRAM_NAME "ubinize" + #include #include #include @@ -36,9 +39,6 @@ #include "common.h" #include "ubiutils-common.h" -#define PROGRAM_VERSION "1.2" -#define PROGRAM_NAME "ubinize" - static const char *doc = PROGRAM_NAME " version " PROGRAM_VERSION " - a tool to generate UBI images. An UBI image may contain one or more UBI " "volumes which have to be defined in the input configuration ini-file. The " diff --git a/ubi-utils/src/ubirename.c b/ubi-utils/src/ubirename.c index 00c53e4..295bfc7 100644 --- a/ubi-utils/src/ubirename.c +++ b/ubi-utils/src/ubirename.c @@ -21,6 +21,9 @@ * Author: Richard Titmuss */ +#define PROGRAM_VERSION "1.0" +#define PROGRAM_NAME "ubirename" + #include #include #include @@ -30,9 +33,6 @@ #include #include "common.h" -#define PROGRAM_VERSION "1.0" -#define PROGRAM_NAME "ubirename" - static const char *usage = "Usage: " PROGRAM_NAME " [ |...]\n\n" "Example: " PROGRAM_NAME "/dev/ubi0 A B C D - rename volume A to B, and C to D\n\n" diff --git a/ubi-utils/src/ubirmvol.c b/ubi-utils/src/ubirmvol.c index 4fbe73a..334bb38 100644 --- a/ubi-utils/src/ubirmvol.c +++ b/ubi-utils/src/ubirmvol.c @@ -23,6 +23,9 @@ * Frank Haverkamp */ +#define PROGRAM_VERSION "1.1" +#define PROGRAM_NAME "ubirmvol" + #include #include #include @@ -32,9 +35,6 @@ #include #include "common.h" -#define PROGRAM_VERSION "1.1" -#define PROGRAM_NAME "ubirmvol" - /* The variables below are set by command line arguments */ struct args { int vol_id; diff --git a/ubi-utils/src/ubirsvol.c b/ubi-utils/src/ubirsvol.c index 683e606..a622ea6 100644 --- a/ubi-utils/src/ubirsvol.c +++ b/ubi-utils/src/ubirsvol.c @@ -23,6 +23,9 @@ * Frank Haverkamp */ +#define PROGRAM_VERSION "1.1" +#define PROGRAM_NAME "ubirsvol" + #include #include #include @@ -33,9 +36,6 @@ #include "common.h" #include "ubiutils-common.h" -#define PROGRAM_VERSION "1.1" -#define PROGRAM_NAME "ubirsvol" - /* The variables below are set by command line arguments */ struct args { int vol_id; diff --git a/ubi-utils/src/ubiupdatevol.c b/ubi-utils/src/ubiupdatevol.c index b314b58..4521138 100644 --- a/ubi-utils/src/ubiupdatevol.c +++ b/ubi-utils/src/ubiupdatevol.c @@ -24,6 +24,9 @@ * Artem Bityutskiy */ +#define PROGRAM_VERSION "1.2" +#define PROGRAM_NAME "ubiupdatevol" + #include #include #include @@ -37,9 +40,6 @@ #include #include "common.h" -#define PROGRAM_VERSION "1.2" -#define PROGRAM_NAME "ubiupdatevol" - struct args { int truncate; const char *node; diff --git a/ubi-utils/src/ubiutils-common.c b/ubi-utils/src/ubiutils-common.c index da5156d..6609a6b 100644 --- a/ubi-utils/src/ubiutils-common.c +++ b/ubi-utils/src/ubiutils-common.c @@ -23,6 +23,8 @@ * Adrian Hunter */ +#define PROGRAM_NAME "ubiutils" + #include #include #include -- cgit v1.2.3