From patchwork Mon Sep 8 06:45:21 2008 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grant Erickson X-Patchwork-Id: 201 Return-Path: X-Original-To: patchwork@ozlabs.org Delivered-To: patchwork@ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 111F4DDE1D for ; Mon, 8 Sep 2008 16:45:43 +1000 (EST) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.68 #1 (Red Hat Linux)) id 1KcaV4-0003Ui-D9; Mon, 08 Sep 2008 06:45:26 +0000 Received: from relay02.pair.com ([209.68.5.16]) by bombadil.infradead.org with smtp (Exim 4.68 #1 (Red Hat Linux)) id 1KcaV2-0003Ij-DW for linux-mtd@lists.infradead.org; Mon, 08 Sep 2008 06:45:24 +0000 Received: (qmail 89151 invoked by uid 0); 8 Sep 2008 06:45:22 -0000 Received: from unknown (HELO localhost.localdomain) (unknown) by unknown with SMTP; 8 Sep 2008 06:45:22 -0000 X-pair-Authenticated: 66.134.71.115 From: Grant Erickson To: linux-mtd@lists.infradead.org Subject: [PATCH 1/6] [MTD-UTILS] nanddump: Qualifier Clean-up Date: Sun, 7 Sep 2008 23:45:21 -0700 Message-Id: <1220856321-22712-1-git-send-email-gerickson@nuovations.com> X-Mailer: git-send-email 1.6.0.1 Organization: Nuovation System Designs, LLC X-Spam-Score: 0.0 (/) X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.9 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-mtd-bounces@lists.infradead.org Errors-To: linux-mtd-bounces+patchwork=ozlabs.org@lists.infradead.org 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 diff --git a/nanddump.c b/nanddump.c index be40287..e35caf8 100644 --- a/nanddump.c +++ b/nanddump.c @@ -32,11 +32,11 @@ #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;