All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] Staging: dt3155: make local variables static
@ 2010-07-23 20:03 H Hartley Sweeten
  2010-07-26 22:34 ` Greg KH
  0 siblings, 1 reply; 3+ messages in thread
From: H Hartley Sweeten @ 2010-07-23 20:03 UTC (permalink / raw)
  To: Linux Kernel; +Cc: devel, gregkh, ss, joe

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;


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] Staging: dt3155: make local variables static
  2010-07-23 20:03 [PATCH v2] Staging: dt3155: make local variables static H Hartley Sweeten
@ 2010-07-26 22:34 ` Greg KH
  2010-07-26 23:09   ` H Hartley Sweeten
  0 siblings, 1 reply; 3+ messages in thread
From: Greg KH @ 2010-07-26 22:34 UTC (permalink / raw)
  To: H Hartley Sweeten; +Cc: Linux Kernel, devel, gregkh, ss, joe

On Fri, Jul 23, 2010 at 01:03:34PM -0700, H Hartley Sweeten wrote:
> 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.

This doesn't apply after applying your previous patch to this file :(

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: [PATCH v2] Staging: dt3155: make local variables static
  2010-07-26 22:34 ` Greg KH
@ 2010-07-26 23:09   ` H Hartley Sweeten
  0 siblings, 0 replies; 3+ messages in thread
From: H Hartley Sweeten @ 2010-07-26 23:09 UTC (permalink / raw)
  To: Greg KH; +Cc: devel, joe, ss, gregkh, Linux Kernel

On Monday, July 26, 2010 3:35 PM, Greg KH wrote:
> On Fri, Jul 23, 2010 at 01:03:34PM -0700, H Hartley Sweeten wrote:
>> 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.
>
> This doesn't apply after applying your previous patch to this file :(

Oops.. I'll fix it up and repost.

Regards,
Hartley

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-07-26 23:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-23 20:03 [PATCH v2] Staging: dt3155: make local variables static H Hartley Sweeten
2010-07-26 22:34 ` Greg KH
2010-07-26 23:09   ` H Hartley Sweeten

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.