Staging VME: Fix remaining checkpatch.pl errors.
authorVincent Bossier <vincent.bossier@gmail.com>
Fri, 3 Jun 2011 09:07:39 +0000 (10:07 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 28 Jun 2011 21:04:53 +0000 (14:04 -0700)
This patch solves all the existing issues reported by checkpatch.pl in the VME
sub-system.

Signed-off-by: Vincent Bossier <vincent.bossier@gmail.com>
Acked-by: Martyn Welch <martyn.welch@ge.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/vme/boards/vme_vmivme7805.c
drivers/staging/vme/bridges/vme_ca91cx42.c
drivers/staging/vme/bridges/vme_tsi148.c
drivers/staging/vme/devices/vme_user.c
drivers/staging/vme/vme.h

index 80eaa0c4fe1c6a360c0f844538fdc8bd1597d526..8e05bb4e135a55241dfb13806c79d543039532dc 100644 (file)
@@ -27,9 +27,9 @@ static void __exit vmic_exit(void);
 /** Base address to access FPGA register */
 static void *vmic_base;
 
-static char driver_name[] = "vmivme_7805";
+static const char driver_name[] = "vmivme_7805";
 
-static struct pci_device_id vmic_ids[] = {
+static DEFINE_PCI_DEVICE_TABLE(vmic_ids) = {
        { PCI_DEVICE(PCI_VENDOR_ID_VMIC, PCI_DEVICE_ID_VTIMR) },
        { },
 };
index a4007287ef4707e9fc431c13443951b8066937b7..1c94ae6b867fa3f8b5e5bb0bab37de7eec0cdd83 100644 (file)
@@ -42,7 +42,7 @@ static void __exit ca91cx42_exit(void);
 /* Module parameters */
 static int geoid;
 
-static char driver_name[] = "vme_ca91cx42";
+static const char driver_name[] = "vme_ca91cx42";
 
 static DEFINE_PCI_DEVICE_TABLE(ca91cx42_ids) = {
        { PCI_DEVICE(PCI_VENDOR_ID_TUNDRA, PCI_DEVICE_ID_TUNDRA_CA91C142) },
index 106aa9daff483ecc546a33e01ddc3cddd4dd193b..9c539513c74be7facdefc62613a4fd262292adb0 100644 (file)
@@ -44,7 +44,7 @@ static void __exit tsi148_exit(void);
 static int err_chk;
 static int geoid;
 
-static char driver_name[] = "vme_tsi148";
+static const char driver_name[] = "vme_tsi148";
 
 static DEFINE_PCI_DEVICE_TABLE(tsi148_ids) = {
        { PCI_DEVICE(PCI_VENDOR_ID_TUNDRA, PCI_DEVICE_ID_TUNDRA_TSI148) },
index a571173249cfc6e543b7c26b548ff4f20e574a01..633a64259f1a0fb70322facd8c9d9783858c5a2e 100644 (file)
@@ -41,7 +41,7 @@
 #include "vme_user.h"
 
 static DEFINE_MUTEX(vme_user_mutex);
-static char driver_name[] = "vme_user";
+static const char driver_name[] = "vme_user";
 
 static int bus[USER_BUS_MAX];
 static unsigned int bus_num;
@@ -91,7 +91,7 @@ static unsigned int bus_num;
 /*
  * Structure to handle image related parameters.
  */
-typedef struct {
+struct image_desc {
        void *kern_buf; /* Buffer address in kernel space */
        dma_addr_t pci_buf;     /* Buffer address in PCI address space */
        unsigned long long size_buf;    /* Buffer size */
@@ -99,10 +99,10 @@ typedef struct {
        struct device *device;  /* Sysfs device */
        struct vme_resource *resource;  /* VME resource */
        int users;              /* Number of current users */
-} image_desc_t;
-static image_desc_t image[VME_DEVS];
+};
+static struct image_desc image[VME_DEVS];
 
-typedef struct {
+struct driver_stats {
        unsigned long reads;
        unsigned long writes;
        unsigned long ioctls;
@@ -111,8 +111,8 @@ typedef struct {
        unsigned long dmaErrors;
        unsigned long timeouts;
        unsigned long external;
-} driver_stats_t;
-static driver_stats_t statistics;
+};
+static struct driver_stats statistics;
 
 static struct cdev *vme_user_cdev;             /* Character device */
 static struct class *vme_user_sysfs_class;     /* Sysfs class */
@@ -138,7 +138,7 @@ static long vme_user_unlocked_ioctl(struct file *, unsigned int, unsigned long);
 static int __devinit vme_user_probe(struct device *, int, int);
 static int __devexit vme_user_remove(struct device *, int, int);
 
-static struct file_operations vme_user_fops = {
+static const struct file_operations vme_user_fops = {
        .open = vme_user_open,
        .release = vme_user_release,
        .read = vme_user_read,
@@ -773,6 +773,7 @@ static int __devinit vme_user_probe(struct device *dev, int cur_bus,
 
        /* Add sysfs Entries */
        for (i = 0; i < VME_DEVS; i++) {
+               int num;
                switch (type[i]) {
                case MASTER_MINOR:
                        sprintf(name, "bus/vme/m%%d");
@@ -789,10 +790,9 @@ static int __devinit vme_user_probe(struct device *dev, int cur_bus,
                        break;
                }
 
-               image[i].device =
-                       device_create(vme_user_sysfs_class, NULL,
-                               MKDEV(VME_MAJOR, i), NULL, name,
-                               (type[i] == SLAVE_MINOR) ? i - (MASTER_MAX + 1) : i);
+               num = (type[i] == SLAVE_MINOR) ? i - (MASTER_MAX + 1) : i;
+               image[i].device = device_create(vme_user_sysfs_class, NULL,
+                                       MKDEV(VME_MAJOR, i), NULL, name, num);
                if (IS_ERR(image[i].device)) {
                        printk(KERN_INFO "%s: Error creating sysfs device\n",
                                driver_name);
index 48768ca97e16ad3cb1e802c689d528cf1278dacb..4155d8c2a53127b9f88452a88475733c2787013a 100644 (file)
@@ -98,7 +98,7 @@ struct vme_device_id {
 
 struct vme_driver {
        struct list_head node;
-       char *name;
+       const char *name;
        const struct vme_device_id *bind_table;
        int (*probe)  (struct device *, int, int);
        int (*remove) (struct device *, int, int);