[S390] Avoid excessive inlining.
[deliverable/linux.git] / drivers / s390 / block / dasd_proc.c
index 1aa3c261718a6813f34105e42db85ce7c054513f..8b7e11815d7044fa4ba1490cb2fe5859f4137126 100644 (file)
@@ -11,7 +11,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/ctype.h>
 #include <linux/seq_file.h>
 #include <linux/vmalloc.h>
@@ -29,7 +28,7 @@ static struct proc_dir_entry *dasd_proc_root_entry = NULL;
 static struct proc_dir_entry *dasd_devices_entry = NULL;
 static struct proc_dir_entry *dasd_statistics_entry = NULL;
 
-static inline char *
+static char *
 dasd_get_user_string(const char __user *user_buf, size_t user_len)
 {
        char *buffer;
@@ -155,7 +154,7 @@ static struct file_operations dasd_devices_file_ops = {
        .release        = seq_release,
 };
 
-static inline int
+static int
 dasd_calc_metrics(char *page, char **start, off_t off,
                  int count, int *eof, int len)
 {
@@ -168,8 +167,8 @@ dasd_calc_metrics(char *page, char **start, off_t off,
        return len;
 }
 
-static inline char *
-dasd_statistics_array(char *str, int *array, int shift)
+static char *
+dasd_statistics_array(char *str, unsigned int *array, int shift)
 {
        int i;
 
@@ -294,23 +293,40 @@ out_error:
 #endif                         /* CONFIG_DASD_PROFILE */
 }
 
+/*
+ * Create dasd proc-fs entries.
+ * In case creation failed, cleanup and return -ENOENT.
+ */
 int
 dasd_proc_init(void)
 {
        dasd_proc_root_entry = proc_mkdir("dasd", &proc_root);
+       if (!dasd_proc_root_entry)
+               goto out_nodasd;
        dasd_proc_root_entry->owner = THIS_MODULE;
        dasd_devices_entry = create_proc_entry("devices",
                                               S_IFREG | S_IRUGO | S_IWUSR,
                                               dasd_proc_root_entry);
+       if (!dasd_devices_entry)
+               goto out_nodevices;
        dasd_devices_entry->proc_fops = &dasd_devices_file_ops;
        dasd_devices_entry->owner = THIS_MODULE;
        dasd_statistics_entry = create_proc_entry("statistics",
                                                  S_IFREG | S_IRUGO | S_IWUSR,
                                                  dasd_proc_root_entry);
+       if (!dasd_statistics_entry)
+               goto out_nostatistics;
        dasd_statistics_entry->read_proc = dasd_statistics_read;
        dasd_statistics_entry->write_proc = dasd_statistics_write;
        dasd_statistics_entry->owner = THIS_MODULE;
        return 0;
+
+ out_nostatistics:
+       remove_proc_entry("devices", dasd_proc_root_entry);
+ out_nodevices:
+       remove_proc_entry("dasd", &proc_root);
+ out_nodasd:
+       return -ENOENT;
 }
 
 void
This page took 0.036506 seconds and 5 git commands to generate.