All of lore.kernel.org
 help / color / mirror / Atom feed
From: Adrian Bunk <bunk@stusta.de>
To: Andrew Morton <akpm@osdl.org>, Ingo Molnar <mingo@elte.hu>
Cc: linux-kernel@vger.kernel.org
Subject: [-mm patch] kernel/lockdep.c: possible cleanups
Date: Wed, 28 Jun 2006 18:55:00 +0200	[thread overview]
Message-ID: <20060628165500.GV13915@stusta.de> (raw)
In-Reply-To: <20060627015211.ce480da6.akpm@osdl.org>

On Tue, Jun 27, 2006 at 01:52:11AM -0700, Andrew Morton wrote:
>...
> Changes since 2.6.17-mm2:
>...
> +lockdep-core.patch
>...
>  Locking validator
>...

This patch contains the following possible cleanups:
- make the needlessly global variable lockdep_init_error static
- make the needlessly global lockdep_print_held_locks() static
- #if 0 the unused global print_lock_classes()
  (this also implies to #if 0 some static functions)

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

---

 include/linux/lockdep.h    |    5 -----
 kernel/lockdep.c           |   10 ++++++++--
 kernel/lockdep_internals.h |    7 -------
 3 files changed, 8 insertions(+), 14 deletions(-)

--- linux-2.6.17-mm3-full/kernel/lockdep_internals.h.old	2006-06-27 17:53:22.000000000 +0200
+++ linux-2.6.17-mm3-full/kernel/lockdep_internals.h	2006-06-27 17:53:56.000000000 +0200
@@ -49,13 +49,6 @@
 
 #ifdef CONFIG_DEBUG_LOCKDEP
 /*
- * We cannot printk in early bootup code. Not even early_printk()
- * might work. So we mark any initialization errors and printk
- * about it later on, in lockdep_info().
- */
-extern int lockdep_init_error;
-
-/*
  * Various lockdep statistics:
  */
 extern atomic_t chain_lookup_hits;
--- linux-2.6.17-mm3-full/include/linux/lockdep.h.old	2006-06-27 17:54:35.000000000 +0200
+++ linux-2.6.17-mm3-full/include/linux/lockdep.h	2006-06-27 17:54:57.000000000 +0200
@@ -191,9 +191,6 @@
 extern void lockdep_reset_lock(struct lockdep_map *lock);
 extern void lockdep_free_key_range(void *start, unsigned long size);
 
-extern void print_lock_classes(void);
-extern void lockdep_print_held_locks(struct task_struct *task);
-
 extern void lockdep_off(void);
 extern void lockdep_on(void);
 extern int lockdep_internal(void);
@@ -258,8 +255,6 @@
 # define lock_release(l, n, i)			do { } while (0)
 # define lockdep_init()				do { } while (0)
 # define lockdep_info()				do { } while (0)
-# define print_lock_classes()			do { } while (0)
-# define lockdep_print_held_locks(task)		do { (void)(task); } while (0)
 # define lockdep_init_map(lock, name, key)	do { } while (0)
 # define lockdep_set_class(lock, key)		do { (void)(key); } while (0)
 # define INIT_LOCKDEP
--- linux-2.6.17-mm3-full/kernel/lockdep.c.old	2006-06-27 17:54:03.000000000 +0200
+++ linux-2.6.17-mm3-full/kernel/lockdep.c	2006-06-27 18:55:55.000000000 +0200
@@ -262,7 +262,7 @@
  * might work. So we mark any initialization errors and printk
  * about it later on, in lockdep_info().
  */
-int lockdep_init_error;
+static int lockdep_init_error;
 
 /*
  * Various lockdep statistics:
@@ -373,6 +373,7 @@
 	printk("){%c%c%c%c}", c1, c2, c3, c4);
 }
 
+#if 0
 static void print_lock_name_field(struct lock_class *class)
 {
 	const char *name;
@@ -390,6 +391,7 @@
 			printk("/%d", class->subclass);
 	}
 }
+#endif  /*  0  */
 
 static void print_lockdep_cache(struct lockdep_map *lock)
 {
@@ -410,7 +412,7 @@
 	print_ip_sym(hlock->acquire_ip);
 }
 
-void lockdep_print_held_locks(struct task_struct *curr)
+static void lockdep_print_held_locks(struct task_struct *curr)
 {
 	int i, depth = curr->lockdep_depth;
 
@@ -488,6 +490,8 @@
 	}
 }
 
+#if 0
+
 /*
  * printk all locks that are taken after this lock:
  */
@@ -539,6 +543,8 @@
 	}
 }
 
+#endif  /*  0  */
+
 /*
  * Add a new dependency to the head of the list:
  */


  parent reply	other threads:[~2006-06-28 17:05 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-27  8:52 2.6.17-mm3 Andrew Morton
2006-06-27  9:14 ` 2.6.17-mm3: no help text for READAHEAD_ALLOW_OVERHEADS Adrian Bunk
2006-06-27 13:43   ` Wu Fengguang
2006-06-27 13:43     ` Wu Fengguang
2006-06-27 14:40     ` Adrian Bunk
2006-06-27 15:52       ` Wu Fengguang
2006-06-27 15:52         ` Wu Fengguang
2006-06-27 17:46       ` Randy.Dunlap
2006-06-27 17:55         ` Adrian Bunk
2006-06-27  9:28 ` [patch] irq: fix arch/i386/kernel/irq.c gcc warning Ingo Molnar
2006-06-27 11:06   ` Björn Steinbrink
2006-06-27 11:14 ` x86_64-mm-ieee1394-early.patch (was Re: 2.6.17-mm3) Stefan Richter
2006-06-27 11:17 ` 2.6.17-mm3 Reuben Farrelly
2006-06-27 11:48 ` 2.6.17-mm3 Reuben Farrelly
2006-06-27 14:12 ` 2.6.17-mm3 Michal Piotrowski
2006-07-08  2:22   ` 2.6.17-mm3 Stephen Hemminger
2006-07-08 10:51     ` 2.6.17-mm3 Michal Piotrowski
2006-07-09 10:01       ` 2.6.17-mm3 Herbert Xu
2006-06-27 21:38 ` 2.6.17-mm3 Steve Fox
2006-06-27 23:12   ` 2.6.17-mm3 Martin Bligh
2006-06-27 22:40 ` 2.6.17-mm3: arm: *_irq_wake compile error Adrian Bunk
2006-06-28  7:09   ` Thomas Gleixner
2006-06-28  7:12     ` Andrew Morton
2006-06-28  7:20       ` Thomas Gleixner
2006-06-28  8:13         ` Ingo Molnar
2006-06-28  8:30           ` [patch] genirq: rename desc->handler to desc->chip, sparc64 fix Ingo Molnar
2006-06-28  8:39             ` David Miller
2006-06-28  8:48               ` Andrew Morton
2006-06-28  8:47                 ` Ingo Molnar
2006-06-28  9:24                 ` David Miller
2006-06-29  4:58                 ` Paul Mackerras
2006-06-29  6:42                   ` Ingo Molnar
2006-06-28 12:03 ` 2.6.17-mm3 - mutex warning in usbhid, battery problem, and slab corruption Rafael J. Wysocki
2006-06-28 12:09   ` Andrew Morton
2006-06-28 14:14 ` 2.6.17-mm3 Cedric Le Goater
2006-06-28 16:54 ` [-mm patch] make drivers/scsi/aic7xxx/aic79xx_core.:ahd_set_tags() static Adrian Bunk
2006-06-28 16:54 ` [-mm patch] kernel/rcutorture.c: make code static Adrian Bunk
2006-06-28 17:13   ` Paul E. McKenney
2006-06-28 17:17     ` Adrian Bunk
2006-06-28 17:49       ` Paul E. McKenney
2006-06-28 20:18   ` Paul E. McKenney
2006-06-28 16:55 ` Adrian Bunk [this message]
2006-06-29 13:49   ` [-mm patch] kernel/lockdep.c: possible cleanups Ingo Molnar
2006-06-28 16:55 ` [-mm patch] fs/ecryptfs/: " Adrian Bunk
2006-06-28 18:40   ` Michael Halcrow

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=20060628165500.GV13915@stusta.de \
    --to=bunk@stusta.de \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    /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 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.