public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: H Hartley Sweeten <hartleys@visionengravers.com>
To: Linux Kernel <linux-kernel@vger.kernel.org>
Cc: <devel@driverdev.osuosl.org>, <gregkh@suse.de>, <ss@aao.gov.au>,
	<joe@perches.com>
Subject: [PATCH v2] Staging: dt3155: make local variables static
Date: Fri, 23 Jul 2010 13:03:34 -0700	[thread overview]
Message-ID: <201007231303.34672.hartleys@visionengravers.com> (raw)

The symbols dt3155_dev_open, unique_tag, and allocatorAddr are only used in
the file dt3155_drv.c and should be static. Also, as pointed out by Joe Perches,
static variables do not need initialization so remove them. While here, also
move the definition for allocatorAddr so that all the variables are declared at
one place in the code.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
Cc: Scott Smedley <ss@aao.gov.au>
Cc: Joe Perches <joe@perches.com>

---

diff --git a/drivers/staging/dt3155/dt3155_drv.c b/drivers/staging/dt3155/dt3155_drv.c
index 9e7b880..da02741 100644
--- a/drivers/staging/dt3155/dt3155_drv.c
+++ b/drivers/staging/dt3155/dt3155_drv.c
@@ -112,20 +112,14 @@ int dt3155_major = 0;
 struct dt3155_status dt3155_status[MAXBOARDS];
 
 /* kernel logical address of the board */
-static void __iomem *dt3155_lbase[MAXBOARDS] = { NULL
-#if MAXBOARDS == 2
-				      , NULL
-#endif
-};
+static void __iomem *dt3155_lbase[MAXBOARDS];
 
-u32  dt3155_dev_open[MAXBOARDS] = {0
-#if MAXBOARDS == 2
-				       , 0
-#endif
-};
+static u32  dt3155_dev_open[MAXBOARDS];
 
 u32  ndevices = 0;
-u32 unique_tag = 0;;
+static u32 unique_tag;
+
+static u32 allocatorAddr;
 
 
 /*
@@ -937,9 +931,6 @@ err:
   return -EIO;
 }
 
-u32 allocatorAddr = 0;
-
-
 int dt3155_init(void)
 {
   struct dt3155_status *dts;


             reply	other threads:[~2010-07-23 20:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-23 20:03 H Hartley Sweeten [this message]
2010-07-26 22:34 ` [PATCH v2] Staging: dt3155: make local variables static Greg KH
2010-07-26 23:09   ` H Hartley Sweeten

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201007231303.34672.hartleys@visionengravers.com \
    --to=hartleys@visionengravers.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@suse.de \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ss@aao.gov.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox