Commit 45f9f018 authored by Nanakos Chrysostomos's avatar Nanakos Chrysostomos Committed by Greg Kroah-Hartman

Staging: vme: devices: vme_user.c: Fix checkpatch.pl issues.

Fix resolves checkpatch.pl issues for vme_user.c file.
Signed-off-by: default avatarNanakos Chrysostomos <nanakos@wired-net.gr>
Signed-off-by: default avatarMartyn Welch <martyn.welch@ge.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent e3613299
...@@ -34,8 +34,8 @@ ...@@ -34,8 +34,8 @@
#include <linux/smp_lock.h> #include <linux/smp_lock.h>
#include <linux/types.h> #include <linux/types.h>
#include <asm/io.h> #include <linux/io.h>
#include <asm/uaccess.h> #include <linux/uaccess.h>
#include "../vme.h" #include "../vme.h"
#include "vme_user.h" #include "vme_user.h"
...@@ -216,21 +216,20 @@ static ssize_t resource_to_user(int minor, char __user *buf, size_t count, ...@@ -216,21 +216,20 @@ static ssize_t resource_to_user(int minor, char __user *buf, size_t count,
/* We copy to kernel buffer */ /* We copy to kernel buffer */
copied = vme_master_read(image[minor].resource, copied = vme_master_read(image[minor].resource,
image[minor].kern_buf, count, *ppos); image[minor].kern_buf, count, *ppos);
if (copied < 0) { if (copied < 0)
return (int)copied; return (int)copied;
}
retval = __copy_to_user(buf, image[minor].kern_buf, retval = __copy_to_user(buf, image[minor].kern_buf,
(unsigned long)copied); (unsigned long)copied);
if (retval != 0) { if (retval != 0) {
copied = (copied - retval); copied = (copied - retval);
printk("User copy failed\n"); printk(KERN_INFO "User copy failed\n");
return -EINVAL; return -EINVAL;
} }
} else { } else {
/* XXX Need to write this */ /* XXX Need to write this */
printk("Currently don't support large transfers\n"); printk(KERN_INFO "Currently don't support large transfers\n");
/* Map in pages from userspace */ /* Map in pages from userspace */
/* Call vme_master_read to do the transfer */ /* Call vme_master_read to do the transfer */
...@@ -264,7 +263,7 @@ static ssize_t resource_from_user(unsigned int minor, const char *buf, ...@@ -264,7 +263,7 @@ static ssize_t resource_from_user(unsigned int minor, const char *buf,
image[minor].kern_buf, copied, *ppos); image[minor].kern_buf, copied, *ppos);
} else { } else {
/* XXX Need to write this */ /* XXX Need to write this */
printk("Currently don't support large transfers\n"); printk(KERN_INFO "Currently don't support large transfers\n");
/* Map in pages from userspace */ /* Map in pages from userspace */
/* Call vme_master_write to do the transfer */ /* Call vme_master_write to do the transfer */
...@@ -313,7 +312,7 @@ static ssize_t buffer_from_user(unsigned int minor, const char *buf, ...@@ -313,7 +312,7 @@ static ssize_t buffer_from_user(unsigned int minor, const char *buf,
} }
static ssize_t vme_user_read(struct file *file, char *buf, size_t count, static ssize_t vme_user_read(struct file *file, char *buf, size_t count,
loff_t * ppos) loff_t *ppos)
{ {
unsigned int minor = MINOR(file->f_dentry->d_inode->i_rdev); unsigned int minor = MINOR(file->f_dentry->d_inode->i_rdev);
ssize_t retval; ssize_t retval;
...@@ -337,7 +336,7 @@ static ssize_t vme_user_read(struct file *file, char *buf, size_t count, ...@@ -337,7 +336,7 @@ static ssize_t vme_user_read(struct file *file, char *buf, size_t count,
else else
okcount = count; okcount = count;
switch (type[minor]){ switch (type[minor]) {
case MASTER_MINOR: case MASTER_MINOR:
retval = resource_to_user(minor, buf, okcount, ppos); retval = resource_to_user(minor, buf, okcount, ppos);
break; break;
...@@ -380,7 +379,7 @@ static ssize_t vme_user_write(struct file *file, const char *buf, size_t count, ...@@ -380,7 +379,7 @@ static ssize_t vme_user_write(struct file *file, const char *buf, size_t count,
else else
okcount = count; okcount = count;
switch (type[minor]){ switch (type[minor]) {
case MASTER_MINOR: case MASTER_MINOR:
retval = resource_from_user(minor, buf, okcount, ppos); retval = resource_from_user(minor, buf, okcount, ppos);
break; break;
...@@ -571,7 +570,7 @@ vme_user_unlocked_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -571,7 +570,7 @@ vme_user_unlocked_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
/* /*
* Unallocate a previously allocated buffer * Unallocate a previously allocated buffer
*/ */
static void buf_unalloc (int num) static void buf_unalloc(int num)
{ {
if (image[num].kern_buf) { if (image[num].kern_buf) {
#ifdef VME_DEBUG #ifdef VME_DEBUG
...@@ -770,16 +769,16 @@ static int __init vme_user_probe(struct device *dev, int cur_bus, int cur_slot) ...@@ -770,16 +769,16 @@ static int __init vme_user_probe(struct device *dev, int cur_bus, int cur_slot)
} }
/* Add sysfs Entries */ /* Add sysfs Entries */
for (i=0; i<VME_DEVS; i++) { for (i = 0; i < VME_DEVS; i++) {
switch (type[i]) { switch (type[i]) {
case MASTER_MINOR: case MASTER_MINOR:
sprintf(name,"bus/vme/m%%d"); sprintf(name, "bus/vme/m%%d");
break; break;
case CONTROL_MINOR: case CONTROL_MINOR:
sprintf(name,"bus/vme/ctl"); sprintf(name, "bus/vme/ctl");
break; break;
case SLAVE_MINOR: case SLAVE_MINOR:
sprintf(name,"bus/vme/s%%d"); sprintf(name, "bus/vme/s%%d");
break; break;
default: default:
err = -EINVAL; err = -EINVAL;
...@@ -790,9 +789,9 @@ static int __init vme_user_probe(struct device *dev, int cur_bus, int cur_slot) ...@@ -790,9 +789,9 @@ static int __init vme_user_probe(struct device *dev, int cur_bus, int cur_slot)
image[i].device = image[i].device =
device_create(vme_user_sysfs_class, NULL, device_create(vme_user_sysfs_class, NULL,
MKDEV(VME_MAJOR, i), NULL, name, MKDEV(VME_MAJOR, i), NULL, name,
(type[i] == SLAVE_MINOR)? i - (MASTER_MAX + 1) : i); (type[i] == SLAVE_MINOR) ? i - (MASTER_MAX + 1) : i);
if (IS_ERR(image[i].device)) { if (IS_ERR(image[i].device)) {
printk("%s: Error creating sysfs device\n", printk(KERN_INFO "%s: Error creating sysfs device\n",
driver_name); driver_name);
err = PTR_ERR(image[i].device); err = PTR_ERR(image[i].device);
goto err_sysfs; goto err_sysfs;
...@@ -804,7 +803,7 @@ static int __init vme_user_probe(struct device *dev, int cur_bus, int cur_slot) ...@@ -804,7 +803,7 @@ static int __init vme_user_probe(struct device *dev, int cur_bus, int cur_slot)
/* Ensure counter set correcty to destroy all sysfs devices */ /* Ensure counter set correcty to destroy all sysfs devices */
i = VME_DEVS; i = VME_DEVS;
err_sysfs: err_sysfs:
while (i > 0){ while (i > 0) {
i--; i--;
device_destroy(vme_user_sysfs_class, MKDEV(VME_MAJOR, i)); device_destroy(vme_user_sysfs_class, MKDEV(VME_MAJOR, i));
} }
...@@ -845,9 +844,8 @@ static int __exit vme_user_remove(struct device *dev, int cur_bus, int cur_slot) ...@@ -845,9 +844,8 @@ static int __exit vme_user_remove(struct device *dev, int cur_bus, int cur_slot)
int i; int i;
/* Remove sysfs Entries */ /* Remove sysfs Entries */
for(i=0; i<VME_DEVS; i++) { for (i = 0; i < VME_DEVS; i++)
device_destroy(vme_user_sysfs_class, MKDEV(VME_MAJOR, i)); device_destroy(vme_user_sysfs_class, MKDEV(VME_MAJOR, i));
}
class_destroy(vme_user_sysfs_class); class_destroy(vme_user_sysfs_class);
for (i = MASTER_MINOR; i < (MASTER_MAX + 1); i++) for (i = MASTER_MINOR; i < (MASTER_MAX + 1); i++)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment