aboutsummaryrefslogtreecommitdiff
path: root/ubi-utils
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2010-09-26 14:48:51 -0400
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2010-09-27 09:31:10 +0300
commite960f7eb17f8d72f00364e9fc9f9a27b5563e318 (patch)
tree9c64699e742b6d220539a8827e29a662d9629fb7 /ubi-utils
parent6edaa0c971aab663cda573ded5013b3b998ee5d4 (diff)
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 <vapier@gentoo.org> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'ubi-utils')
-rw-r--r--ubi-utils/src/libscan.c4
-rw-r--r--ubi-utils/src/libubi.c4
-rw-r--r--ubi-utils/src/libubigen.c4
-rw-r--r--ubi-utils/src/mtdinfo.c6
-rw-r--r--ubi-utils/src/ubiattach.c5
-rw-r--r--ubi-utils/src/ubicrc32.c6
-rw-r--r--ubi-utils/src/ubidetach.c5
-rw-r--r--ubi-utils/src/ubiformat.c6
-rw-r--r--ubi-utils/src/ubimkvol.c6
-rw-r--r--ubi-utils/src/ubinfo.c6
-rw-r--r--ubi-utils/src/ubinize.c6
-rw-r--r--ubi-utils/src/ubirename.c6
-rw-r--r--ubi-utils/src/ubirmvol.c6
-rw-r--r--ubi-utils/src/ubirsvol.c6
-rw-r--r--ubi-utils/src/ubiupdatevol.c6
-rw-r--r--ubi-utils/src/ubiutils-common.c2
16 files changed, 44 insertions, 40 deletions
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 <sys/types.h>
#include <sys/stat.h>
#include <stdint.h>
@@ -35,8 +37,6 @@
#include <crc32.h>
#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 <stdlib.h>
#include <stdio.h>
#include <string.h>
@@ -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 <stdlib.h>
#include <stdint.h>
#include <unistd.h>
@@ -35,8 +37,6 @@
#include <crc32.h>
#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 <stdint.h>
#include <stdio.h>
#include <getopt.h>
@@ -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 <stdio.h>
#include <stdint.h>
#include <getopt.h>
@@ -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 <stdio.h>
#include <stdint.h>
#include <stdlib.h>
@@ -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 <stdio.h>
#include <stdint.h>
#include <getopt.h>
@@ -30,8 +33,6 @@
#include <libubi.h>
#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 <sys/stat.h>
#include <unistd.h>
#include <stdint.h>
@@ -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 <haver@vnet.ibm.com>
*/
+#define PROGRAM_VERSION "1.1"
+#define PROGRAM_NAME "ubimkvol"
+
#include <stdio.h>
#include <stdint.h>
#include <getopt.h>
@@ -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 <stdint.h>
#include <stdio.h>
#include <getopt.h>
@@ -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 <sys/stat.h>
#include <stdlib.h>
#include <getopt.h>
@@ -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 <stdio.h>
#include <stdint.h>
#include <getopt.h>
@@ -30,9 +33,6 @@
#include <libubi.h>
#include "common.h"
-#define PROGRAM_VERSION "1.0"
-#define PROGRAM_NAME "ubirename"
-
static const char *usage =
"Usage: " PROGRAM_NAME " <UBI device node file name> [<old name> <new 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 <haver@vnet.ibm.com>
*/
+#define PROGRAM_VERSION "1.1"
+#define PROGRAM_NAME "ubirmvol"
+
#include <stdio.h>
#include <stdint.h>
#include <getopt.h>
@@ -32,9 +35,6 @@
#include <libubi.h>
#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 <haver@vnet.ibm.com>
*/
+#define PROGRAM_VERSION "1.1"
+#define PROGRAM_NAME "ubirsvol"
+
#include <stdio.h>
#include <stdint.h>
#include <getopt.h>
@@ -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 <fcntl.h>
#include <stdio.h>
#include <stdint.h>
@@ -37,9 +40,6 @@
#include <libubi.h>
#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 <sys/time.h>
#include <sys/types.h>
#include <stdio.h>