[PATCH v3] Staging: dt3155: make local variables static

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxxxxxx>
Cc: Greg Kroah-Hartman <gregkh@xxxxxxx>
Cc: Scott Smedley <ss@xxxxxxxxxx>
Cc: Joe Perches <joe@xxxxxxxxxxx>

---

diff --git a/drivers/staging/dt3155/dt3155_drv.c b/drivers/staging/dt3155/dt3155_drv.c
index 7316996..83af63d 100644
--- a/drivers/staging/dt3155/dt3155_drv.c
+++ b/drivers/staging/dt3155/dt3155_drv.c
@@ -112,21 +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;
 
 /*
  * Stops interrupt generation right away and resets the status
@@ -937,9 +930,6 @@ err:
   return -EIO;
 }
 
-u32 allocatorAddr = 0;
-
-
 static int __init dt3155_init(void)
 {
   struct dt3155_status *dts;
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel


[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux