]> www.infradead.org Git - mtd-utils.git/commitdiff
nanddump: Qualifier Clean-up
authorGrant Erickson <gerickson@nuovations.com>
Sun, 7 Sep 2008 20:45:21 +0000 (20:45 +0000)
committerJosh Boyer <jwboyer@gmail.com>
Mon, 8 Sep 2008 14:28:08 +0000 (10:28 -0400)
Static-qualified all globals except 'main' because they have no use
beyond file scope.
Constant-qualified MTD device and input positional parameter globals.
Constant-qualified argv array.

Signed-off-by: Grant Erickson <gerickson@nuovations.com>
Acked-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: Josh Boyer <jwboyer@gmail.com>
nanddump.c

index be402873e06609c363083dd21b711820075b9b86..e35caf8f58b6c76bd199a6b40a1182afdf4a8d5b 100644 (file)
 #define PROGRAM "nanddump"
 #define VERSION "$Revision: 1.29 $"
 
-struct nand_oobinfo none_oobinfo = {
+static struct nand_oobinfo none_oobinfo = {
        .useecc = MTD_NANDECC_OFF,
 };
 
-void display_help (void)
+static void display_help (void)
 {
        printf("Usage: nanddump [OPTIONS] MTD-device\n"
                        "Dumps the contents of a nand mtd partition.\n"
@@ -54,7 +54,7 @@ void display_help (void)
        exit(0);
 }
 
-void display_version (void)
+static void display_version (void)
 {
        printf(PROGRAM " " VERSION "\n"
                        "\n"
@@ -69,17 +69,17 @@ void display_version (void)
 
 // Option variables
 
-int    ignoreerrors;           // ignore errors
-int    pretty_print;           // print nice in ascii
-int    noecc;                  // don't error correct
-int    omitoob;                // omit oob data
-unsigned long  start_addr;     // start address
-unsigned long  length;         // dump length
-char    *mtddev;               // mtd device name
-char    *dumpfile;             // dump file name
-int    omitbad;
-
-void process_options (int argc, char *argv[])
+static int             ignoreerrors;   // ignore errors
+static int             pretty_print;   // print nice in ascii
+static int             noecc;          // don't error correct
+static int             omitoob;        // omit oob data
+static unsigned long   start_addr;     // start address
+static unsigned long   length;         // dump length
+static const char      *mtddev;        // mtd device name
+static const char      *dumpfile;      // dump file name
+static int             omitbad;
+
+static void process_options (int argc, char * const argv[])
 {
        int error = 0;
 
@@ -159,13 +159,13 @@ void process_options (int argc, char *argv[])
 /*
  * Buffers for reading data from flash
  */
-unsigned char readbuf[4096];
-unsigned char oobbuf[128];
+static unsigned char readbuf[4096];
+static unsigned char oobbuf[128];
 
 /*
  * Main program
  */
-int main(int argc, char **argv)
+int main(int argc, char * const argv[])
 {
        unsigned long ofs, end_addr = 0;
        unsigned long long blockstart = 1;