[-mm patch] drivers/mtd/ubi/: possible cleanups

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Adrian Bunk
Date: Friday, January 19, 2007 - 11:40 am

On Thu, Jan 11, 2007 at 10:26:27PM -0800, Andrew Morton wrote:


This patch contains the following possible cleanups:
- make needlessly global code static
- remove the following unused variable:
  - debug.c: alloc_prints

Signed-off-by: Adrian Bunk <bunk@stusta.de>

---

BTW: Do you really need that many different 
     CONFIG_MTD_UBI_DEBUG_* options?

 drivers/mtd/ubi/cdev.c  |    4 +-
 drivers/mtd/ubi/debug.c |   57 ++++++++++++++++++----------------------
 2 files changed, 28 insertions(+), 33 deletions(-)

--- linux-2.6.20-rc4-mm1/drivers/mtd/ubi/cdev.c.old	2007-01-19 17:49:47.000000000 +0100
+++ linux-2.6.20-rc4-mm1/drivers/mtd/ubi/cdev.c	2007-01-19 17:50:03.000000000 +0100
@@ -47,7 +47,7 @@
 
 static int vol_cdev_open(struct inode *inode, struct file *file);
 static int vol_cdev_release(struct inode *inode, struct file *file);
-loff_t vol_cdev_llseek(struct file *file, loff_t offset, int origin);
+static loff_t vol_cdev_llseek(struct file *file, loff_t offset, int origin);
 static ssize_t vol_cdev_read(struct file *file, __user char *buf,
 			     size_t count, loff_t * offp);
 static ssize_t vol_cdev_write(struct file *file, const char __user *buf,
@@ -224,7 +224,7 @@
  * positive offset in case of success and a negative error code in case of
  * failure.
  */
-loff_t vol_cdev_llseek(struct file *file, loff_t offset, int origin)
+static loff_t vol_cdev_llseek(struct file *file, loff_t offset, int origin)
 {
 	const struct ubi_vtbl_vtr *vtr;
 	struct ubi_vol_desc *desc = file->private_data;
--- linux-2.6.20-rc4-mm1/drivers/mtd/ubi/debug.c.old	2007-01-19 17:50:42.000000000 +0100
+++ linux-2.6.20-rc4-mm1/drivers/mtd/ubi/debug.c	2007-01-19 18:43:59.000000000 +0100
@@ -67,74 +67,69 @@
 static int vb_err_prints;
 #endif
 #ifdef CONFIG_MTD_UBI_DEBUG_MSG_UIF
-int uif_prints = 1;
+static int uif_prints = 1;
 #else
-int uif_prints;
+static int uif_prints;
 #endif
 #ifdef CONFIG_MTD_UBI_DEBUG_MSG_CDEV
-int cdev_prints = 1;
+static int cdev_prints = 1;
 #else
-int cdev_prints;
+static int cdev_prints;
 #endif
 #ifdef CONFIG_MTD_UBI_DEBUG_MSG_GLUEBI
-int gluebi_prints = 1;
+static int gluebi_prints = 1;
 #else
-int gluebi_prints;
+static int gluebi_prints;
 #endif
 #ifdef CONFIG_MTD_UBI_DEBUG_MSG_VMT
-int vmt_prints = 1;
+static int vmt_prints = 1;
 #else
-int vmt_prints;
+static int vmt_prints;
 #endif
 #ifdef CONFIG_MTD_UBI_DEBUG_MSG_UPD
-int upd_prints = 1;
+static int upd_prints = 1;
 #else
-int upd_prints;
+static int upd_prints;
 #endif
 #ifdef CONFIG_MTD_UBI_DEBUG_MSG_VTBL
-int vtbl_prints = 1;
+static int vtbl_prints = 1;
 #else
-int vtbl_prints;
+static int vtbl_prints;
 #endif
 #ifdef CONFIG_MTD_UBI_DEBUG_MSG_ACC
-int acc_prints = 1;
+static int acc_prints = 1;
 #else
-int acc_prints;
+static int acc_prints;
 #endif
 #ifdef CONFIG_MTD_UBI_DEBUG_MSG_EBA
-int eba_prints = 1;
+static int eba_prints = 1;
 #else
-int eba_prints;
+static int eba_prints;
 #endif
 #ifdef CONFIG_MTD_UBI_DEBUG_MSG_WL
-int wl_prints = 1;
+static int wl_prints = 1;
 #else
-int wl_prints;
+static int wl_prints;
 #endif
 #ifdef CONFIG_MTD_UBI_DEBUG_MSG_BGT
-int bgt_prints = 1;
+static int bgt_prints = 1;
 #else
-int bgt_prints;
-#endif
-#ifdef CONFIG_MTD_UBI_DEBUG_MSG_ALLOC
-int alloc_prints = 1;
-#else
-int alloc_prints;
+static int bgt_prints;
 #endif
 #ifdef CONFIG_MTD_UBI_DEBUG_MSG_IO
-int io_prints = 1;
+static int io_prints = 1;
 #else
-int io_prints;
+static int io_prints;
 #endif
 #ifdef CONFIG_MTD_UBI_DEBUG_MSG_BLD
-int bld_prints = 1;
+static int bld_prints = 1;
 #else
-int bld_prints;
+static int bld_prints;
 #endif
 #ifdef CONFIG_MTD_UBI_DEBUG_MSG_SCAN
-int scan_prints = 1;
+static int scan_prints = 1;
 #else
-int scan_prints;
+static int scan_prints;
 #endif
 
 /* If debugging messages should also go to the console */

-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
2.6.20-rc4-mm1, Andrew Morton, (Thu Jan 11, 11:26 pm)
Early ACPI lockup (was Re: 2.6.20-rc4-mm1), Frederik Deweerdt, (Fri Jan 12, 3:20 am)
Re: 2.6.20-rc4-mm1, Mariusz Kozlowski, (Fri Jan 12, 3:25 am)
Re: spurious sparse warnings from linux/aio.h (was: 2.6.20 ..., Suparna Bhattacharya, (Fri Jan 12, 6:11 am)
Re: 2.6.20-rc4-mm1, Frederik Deweerdt, (Fri Jan 12, 6:18 am)
[-mm patch] remove tcp header from tcp_v4_check, Frederik Deweerdt, (Fri Jan 12, 6:33 am)
[-mm patch] remove tcp header from tcp_v4_check (take #2), Frederik Deweerdt, (Fri Jan 12, 6:55 am)
Re: 2.6.20-rc4-mm1, Mariusz Kozlowski, (Fri Jan 12, 8:13 am)
Re: 2.6.20-rc4-mm1, Michal Piotrowski, (Fri Jan 12, 8:16 am)
Re: 2.6.20-rc4-mm1, Mariusz Kozlowski, (Fri Jan 12, 9:12 am)
Re: spurious sparse warnings from linux/aio.h, Tilman Schmidt, (Fri Jan 12, 10:46 am)
Re: 'struct task_struct' has no member named 'mems_allowed ..., Christoph Lameter, (Fri Jan 12, 12:25 pm)
Re: 'struct task_struct' has no member named 'mems_allowed ..., Christoph Lameter, (Fri Jan 12, 2:28 pm)
Re: 'struct task_struct' has no member named 'mems_allowed ..., Christoph Lameter, (Fri Jan 12, 3:00 pm)
Re: Early ACPI lockup (was Re: 2.6.20-rc4-mm1), Len Brown, (Fri Jan 12, 3:53 pm)
Re: Early ACPI lockup (was Re: 2.6.20-rc4-mm1), Frederik Deweerdt, (Fri Jan 12, 4:10 pm)
Re: Early ACPI lockup (was Re: 2.6.20-rc4-mm1), Jiri Slaby, (Fri Jan 12, 4:36 pm)
Re: Early ACPI lockup (was Re: 2.6.20-rc4-mm1), Michal Piotrowski, (Fri Jan 12, 5:08 pm)
Re: Early ACPI lockup (was Re: 2.6.20-rc4-mm1), Jiri Slaby, (Fri Jan 12, 5:43 pm)
Re: Early ACPI lockup (was Re: 2.6.20-rc4-mm1), Frederik Deweerdt, (Fri Jan 12, 5:45 pm)
2.6.20-rc4-mm1: status of sn9c102_pas202bca?, Adrian Bunk, (Sat Jan 13, 12:27 am)
[-mm patch] make mmc_sysfs.c:mmc_key_type static, Adrian Bunk, (Sat Jan 13, 2:56 am)
[-mm patch] make gfs2_change_nlink_i() static, Adrian Bunk, (Sat Jan 13, 2:56 am)
Re: [-mm patch] make mmc_sysfs.c:mmc_key_type static, Pierre Ossman, (Sat Jan 13, 3:38 pm)
Re: 2.6.20-rc4-mm1, Thomas Gleixner, (Sun Jan 14, 2:48 am)
Re: 2.6.20-rc4-mm1, Thomas Gleixner, (Sun Jan 14, 3:46 am)
Re: 2.6.20-rc4-mm1, Thomas Gleixner, (Sun Jan 14, 7:40 am)
Re: 2.6.20-rc4-mm1, Jens Axboe, (Sun Jan 14, 3:05 pm)
Re: 2.6.20-rc4-mm1, Jens Axboe, (Sun Jan 14, 3:20 pm)
Re: 2.6.20-rc4-mm1, Jens Axboe, (Sun Jan 14, 3:30 pm)
Re: 2.6.20-rc4-mm1, Thomas Gleixner, (Sun Jan 14, 3:31 pm)
i810fb fails to load (was: 2.6.20-rc4-mm1), Tilman Schmidt, (Sun Jan 14, 4:52 pm)
Re: i810fb fails to load (was: 2.6.20-rc4-mm1), Andrew Morton, (Sun Jan 14, 5:22 pm)
Re: 2.6.20-rc4-mm1, Ingo Molnar, (Mon Jan 15, 1:22 am)
Re: [-mm patch] make gfs2_change_nlink_i() static, Steven Whitehouse, (Mon Jan 15, 3:31 am)
Re: 2.6.20-rc4-mm1: status of sn9c102_pas202bca?, Mauro Carvalho Chehab, (Mon Jan 15, 4:34 am)
Re: 2.6.20-rc4-mm1, Jens Axboe, (Mon Jan 15, 4:55 pm)
[-mm patch] fs/unionfs/: possible cleanups, Adrian Bunk, (Thu Jan 18, 2:55 pm)
[-mm patch] drivers/mtd/ubi/: possible cleanups, Adrian Bunk, (Fri Jan 19, 11:40 am)
Re: [-mm patch] fs/unionfs/: possible cleanups, Josef Sipek, (Sat Jan 20, 3:06 pm)
[-mm patch] oops in drivers/net/shaper.c, Frederik Deweerdt, (Sat Jan 20, 3:38 pm)
Re: [-mm patch] drivers/mtd/ubi/: possible cleanups, Artem Bityutskiy, (Sun Jan 21, 4:23 am)
Re: i810fb fails to load, Thomas Hellström, (Mon Jan 22, 6:42 am)
[-mm patch] drivers/firewire/: cleanups, Adrian Bunk, (Mon Jan 22, 11:17 am)
Re: i810fb fails to load, Tilman Schmidt, (Mon Jan 22, 11:30 am)
Re: [-mm patch] drivers/firewire/: cleanups, Kristian Høgsberg, (Mon Jan 22, 12:41 pm)
Re: [-mm patch] drivers/firewire/: cleanups, Adrian Bunk, (Mon Jan 22, 1:04 pm)
Re: [-mm patch] drivers/firewire/: cleanups, Kristian Høgsberg, (Mon Jan 22, 1:04 pm)
Re: [-mm patch] drivers/firewire/: cleanups, Stefan Richter, (Mon Jan 22, 1:44 pm)
Re: i810fb fails to load, Dave Airlie, (Mon Jan 22, 2:50 pm)
`make htmldocs` fails, Don Mullis, (Mon Jan 22, 11:02 pm)
Re: `make htmldocs` fails, Randy Dunlap, (Mon Jan 22, 11:22 pm)
Re: `make htmldocs` fails, Greg KH, (Mon Jan 22, 11:35 pm)
Re: `make htmldocs` fails -- 2.6.20-rc4-mm1, Don Mullis, (Mon Jan 22, 11:45 pm)
Re: i810fb fails to load, Thomas Hellström, (Tue Jan 23, 1:10 am)
Re: 2.6.20-rc4-mm1: PCI=n: drivers/net/3c59x.c compile error, Sergei Shtylyov, (Wed Jan 24, 7:12 am)
[-mm patch] MTD_CK804XROM must depend on PCI, Adrian Bunk, (Wed Jan 24, 3:36 pm)
Re: 2.6.20-rc4-mm1: PCI=n: drivers/net/3c59x.c compile error, Sergei Shtylyov, (Sat Feb 17, 12:26 pm)
Re: 2.6.20-rc4-mm1: PCI=n: drivers/net/3c59x.c compile error, Sergei Shtylyov, (Sat Feb 17, 12:32 pm)
Re: 2.6.20-rc4-mm1: PCI=n: drivers/net/3c59x.c compile error, Sergei Shtylyov, (Mon Feb 26, 6:22 am)
[PATCH] different values for OHCI_QUIRK_ZFMICRO, Randy Dunlap, (Tue May 8, 3:17 pm)
Re: [PATCH] different values for OHCI_QUIRK_ZFMICRO, David Brownell, (Tue May 8, 3:34 pm)