lkml.org 
[lkml]   [2006]   [Jun]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[-mm patch] kernel/lockdep.c: possible cleanups
    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:
    */
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2006-06-28 19:08    [W:3.326 / U:0.144 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site