treewide: kmalloc() -> kmalloc_array()
[sfrench/cifs-2.6.git] / arch / um / drivers / ubd_kern.c
index d4e8c497ae868a611edba78d21a798d7755c1c12..83c470364dfb34dce51320322e9b119c10157f3e 100644 (file)
@@ -208,19 +208,6 @@ static int fake_ide_media_proc_show(struct seq_file *m, void *v)
        return 0;
 }
 
-static int fake_ide_media_proc_open(struct inode *inode, struct file *file)
-{
-       return single_open(file, fake_ide_media_proc_show, NULL);
-}
-
-static const struct file_operations fake_ide_media_proc_fops = {
-       .owner          = THIS_MODULE,
-       .open           = fake_ide_media_proc_open,
-       .read           = seq_read,
-       .llseek         = seq_lseek,
-       .release        = single_release,
-};
-
 static void make_ide_entries(const char *dev_name)
 {
        struct proc_dir_entry *dir, *ent;
@@ -231,7 +218,8 @@ static void make_ide_entries(const char *dev_name)
        dir = proc_mkdir(dev_name, proc_ide);
        if(!dir) return;
 
-       ent = proc_create("media", S_IRUGO, dir, &fake_ide_media_proc_fops);
+       ent = proc_create_single("media", S_IRUGO, dir,
+                       fake_ide_media_proc_show);
        if(!ent) return;
        snprintf(name, sizeof(name), "ide0/%s", dev_name);
        proc_symlink(dev_name, proc_ide_root, name);
@@ -1139,9 +1127,9 @@ static int __init ubd_init(void)
                        return -1;
        }
 
-       irq_req_buffer = kmalloc(
-                       sizeof(struct io_thread_req *) * UBD_REQ_BUFFER_SIZE,
-                       GFP_KERNEL
+       irq_req_buffer = kmalloc_array(UBD_REQ_BUFFER_SIZE,
+                                      sizeof(struct io_thread_req *),
+                                      GFP_KERNEL
                );
        irq_remainder = 0;
 
@@ -1149,9 +1137,9 @@ static int __init ubd_init(void)
                printk(KERN_ERR "Failed to initialize ubd buffering\n");
                return -1;
        }
-       io_req_buffer = kmalloc(
-                       sizeof(struct io_thread_req *) * UBD_REQ_BUFFER_SIZE,
-                       GFP_KERNEL
+       io_req_buffer = kmalloc_array(UBD_REQ_BUFFER_SIZE,
+                                     sizeof(struct io_thread_req *),
+                                     GFP_KERNEL
                );
 
        io_remainder = 0;