[PATCH] sysctl: remove insert_at_head from register_sysctl
[safe/jmp/linux-2.6] / arch / s390 / kernel / debug.c
index 06a3fbc..eca3fe5 100644 (file)
@@ -10,7 +10,6 @@
  *    Bugreports to: <Linux390@de.ibm.com>
  */
 
-#include <linux/config.h>
 #include <linux/stddef.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
@@ -121,7 +120,7 @@ struct debug_view debug_hex_ascii_view = {
        NULL
 };
 
-struct debug_view debug_level_view = {
+static struct debug_view debug_level_view = {
        "level",
        &debug_prolog_level_fn,
        NULL,
@@ -130,7 +129,7 @@ struct debug_view debug_level_view = {
        NULL
 };
 
-struct debug_view debug_pages_view = {
+static struct debug_view debug_pages_view = {
        "pages",
        &debug_prolog_pages_fn,
        NULL,
@@ -139,7 +138,7 @@ struct debug_view debug_pages_view = {
        NULL
 };
 
-struct debug_view debug_flush_view = {
+static struct debug_view debug_flush_view = {
         "flush",
         NULL,
         NULL,
@@ -157,18 +156,18 @@ struct debug_view debug_sprintf_view = {
        NULL
 };
 
-
+/* used by dump analysis tools to determine version of debug feature */
 unsigned int debug_feature_version = __DEBUG_FEATURE_VERSION;
 
 /* static globals */
 
 static debug_info_t *debug_area_first = NULL;
 static debug_info_t *debug_area_last = NULL;
-DECLARE_MUTEX(debug_lock);
+static DECLARE_MUTEX(debug_lock);
 
 static int initialized;
 
-static struct file_operations debug_file_ops = {
+static const struct file_operations debug_file_ops = {
        .owner   = THIS_MODULE,
        .read    = debug_output,
        .write   = debug_input,
@@ -192,13 +191,13 @@ debug_areas_alloc(int pages_per_area, int nr_areas)
        debug_entry_t*** areas;
        int i,j;
 
-       areas = (debug_entry_t ***) kmalloc(nr_areas *
+       areas = kmalloc(nr_areas *
                                        sizeof(debug_entry_t**),
                                        GFP_KERNEL);
        if (!areas)
                goto fail_malloc_areas;
        for (i = 0; i < nr_areas; i++) {
-               areas[i] = (debug_entry_t**) kmalloc(pages_per_area *
+               areas[i] = kmalloc(pages_per_area *
                                sizeof(debug_entry_t*),GFP_KERNEL);
                if (!areas[i]) {
                        goto fail_malloc_areas2;
@@ -243,7 +242,7 @@ debug_info_alloc(char *name, int pages_per_area, int nr_areas, int buf_size,
 
        /* alloc everything */
 
-       rc = (debug_info_t*) kmalloc(sizeof(debug_info_t), GFP_KERNEL);
+       rc = kmalloc(sizeof(debug_info_t), GFP_KERNEL);
        if(!rc)
                goto fail_malloc_rc;
        rc->active_entries = kcalloc(nr_areas, sizeof(int), GFP_KERNEL);
@@ -604,13 +603,13 @@ debug_open(struct inode *inode, struct file *file)
        debug_info_t *debug_info, *debug_info_snapshot;
 
        down(&debug_lock);
-       debug_info = (struct debug_info*)file->f_dentry->d_inode->u.generic_ip;
+       debug_info = file->f_path.dentry->d_inode->i_private;
        /* find debug view */
        for (i = 0; i < DEBUG_MAX_VIEWS; i++) {
                if (!debug_info->views[i])
                        continue;
                else if (debug_info->debugfs_entries[i] ==
-                        file->f_dentry) {
+                        file->f_path.dentry) {
                        goto found;     /* found view ! */
                }
        }
@@ -635,7 +634,7 @@ found:
                rc = -ENOMEM;
                goto out;
        }
-       p_info = (file_private_info_t *) kmalloc(sizeof(file_private_info_t),
+       p_info = kmalloc(sizeof(file_private_info_t),
                                                GFP_KERNEL);
        if(!p_info){
                if(debug_info_snapshot)
@@ -853,7 +852,6 @@ debug_finish_entry(debug_info_t * id, debug_entry_t* active, int level,
 static int debug_stoppable=1;
 static int debug_active=1;
 
-#define CTL_S390DBF 5677
 #define CTL_S390DBF_STOPPABLE 5678
 #define CTL_S390DBF_ACTIVE 5679
 
@@ -906,7 +904,7 @@ static struct ctl_table s390dbf_dir_table[] = {
        { .ctl_name = 0 }
 };
 
-struct ctl_table_header *s390dbf_sysctl_header;
+static struct ctl_table_header *s390dbf_sysctl_header;
 
 void
 debug_stop_all(void)
@@ -1055,7 +1053,7 @@ __init debug_init(void)
 {
        int rc = 0;
 
-       s390dbf_sysctl_header = register_sysctl_table(s390dbf_dir_table, 1);
+       s390dbf_sysctl_header = register_sysctl_table(s390dbf_dir_table);
        down(&debug_lock);
        debug_debugfs_root_entry = debugfs_create_dir(DEBUG_DIR_ROOT,NULL);
        printk(KERN_INFO "debug: Initialization complete\n");
@@ -1301,8 +1299,7 @@ out:
  * flushes debug areas
  */
  
-void
-debug_flush(debug_info_t* id, int area)
+static void debug_flush(debug_info_t* id, int area)
 {
         unsigned long flags;
         int i,j;
@@ -1512,8 +1509,7 @@ out:
 /*
  * clean up module
  */
-void
-__exit debug_exit(void)
+static void __exit debug_exit(void)
 {
        debugfs_remove(debug_debugfs_root_entry);
        unregister_sysctl_table(s390dbf_sysctl_header);