]> git.karo-electronics.de Git - linux-beck.git/commitdiff
staging: xillybus: Fixed sparse errors
authorEli Billauer <eli.billauer@gmail.com>
Wed, 31 Jul 2013 08:22:43 +0000 (11:22 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 1 Aug 2013 00:41:56 +0000 (17:41 -0700)
Changes:

* xillybus.h: __iomem added to struct xilly_endpoint -> registers to suppress
  "different address spaces" errors.

* xillybus_core.c: __user added as required for the same reason.

* The two member names of struct xilly_endpoint_hardware of the form
  sync_single_for_{cpu,device} were changed to something that won't look
  like the well-known functions.

* All *.c files: Variables and functions made static as required.

Reported-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Eli Billauer <eli.billauer@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/xillybus/xillybus.h
drivers/staging/xillybus/xillybus_core.c
drivers/staging/xillybus/xillybus_of.c
drivers/staging/xillybus/xillybus_pcie.c

index b62faeb31c532f26bbf9db56b708e91ef358177c..d3fc8aa896de7b6f889f669720995c7ba025339b 100644 (file)
@@ -122,7 +122,7 @@ struct xilly_endpoint {
 
        struct list_head ep_list;
        int dma_using_dac; /* =1 if 64-bit DMA is used, =0 otherwise. */
-       u32 *registers;
+       __iomem u32 *registers;
        int fatal_error;
 
        struct mutex register_mutex;
@@ -150,11 +150,11 @@ struct xilly_endpoint {
 
 struct xilly_endpoint_hardware {
        struct module *owner;
-       void (*sync_single_for_cpu)(struct xilly_endpoint *,
+       void (*hw_sync_sgl_for_cpu)(struct xilly_endpoint *,
                                    dma_addr_t,
                                    size_t,
                                    int);
-       void (*sync_single_for_device)(struct xilly_endpoint *,
+       void (*hw_sync_sgl_for_device)(struct xilly_endpoint *,
                                       dma_addr_t,
                                       size_t,
                                       int);
index 9ccd6aa7e8c5fe504a96a6a085a592aa06ca5bcb..3d7471a72077a522188c4d5574f90f3d0fedb4c9 100644 (file)
@@ -71,7 +71,7 @@ static struct class *xillybus_class;
 
 static LIST_HEAD(list_of_endpoints);
 static struct mutex ep_list_lock;
-struct workqueue_struct *xillybus_wq;
+static struct workqueue_struct *xillybus_wq;
 
 /*
  * Locking scheme: Mutexes protect invocations of character device methods.
@@ -145,7 +145,7 @@ irqreturn_t xillybus_isr(int irq, void *data)
        buf_size = ep->msg_buf_size/sizeof(u32);
 
 
-       ep->ephw->sync_single_for_cpu(ep,
+       ep->ephw->hw_sync_sgl_for_cpu(ep,
                                      ep->msgbuf_dma_addr,
                                      ep->msg_buf_size,
                                      DMA_FROM_DEVICE);
@@ -163,7 +163,7 @@ irqreturn_t xillybus_isr(int irq, void *data)
                                pr_err("xillybus: Lost sync with "
                                       "interrupt messages. Stopping.\n");
                        else {
-                               ep->ephw->sync_single_for_device(
+                               ep->ephw->hw_sync_sgl_for_device(
                                        ep,
                                        ep->msgbuf_dma_addr,
                                        ep->msg_buf_size,
@@ -297,7 +297,7 @@ irqreturn_t xillybus_isr(int irq, void *data)
                }
        }
 
-       ep->ephw->sync_single_for_device(ep,
+       ep->ephw->hw_sync_sgl_for_device(ep,
                                         ep->msgbuf_dma_addr,
                                         ep->msg_buf_size,
                                         DMA_FROM_DEVICE);
@@ -796,7 +796,7 @@ static int xilly_obtain_idt(struct xilly_endpoint *endpoint)
                return rc;
        }
 
-       endpoint->ephw->sync_single_for_cpu(
+       endpoint->ephw->hw_sync_sgl_for_cpu(
                channel->endpoint,
                channel->wr_buffers[0]->dma_addr,
                channel->wr_buf_size,
@@ -832,8 +832,8 @@ static int xilly_obtain_idt(struct xilly_endpoint *endpoint)
        return 0; /* Success */
 }
 
-static ssize_t xillybus_read(struct file *filp, char *userbuf, size_t count,
-                            loff_t *f_pos)
+static ssize_t xillybus_read(struct file *filp, char __user *userbuf,
+                            size_t count, loff_t *f_pos)
 {
        ssize_t rc;
        unsigned long flags;
@@ -917,7 +917,7 @@ static ssize_t xillybus_read(struct file *filp, char *userbuf, size_t count,
                if (!empty) { /* Go on, now without the spinlock */
 
                        if (bufpos == 0) /* Position zero means it's virgin */
-                               channel->endpoint->ephw->sync_single_for_cpu(
+                               channel->endpoint->ephw->hw_sync_sgl_for_cpu(
                                        channel->endpoint,
                                        channel->wr_buffers[bufidx]->dma_addr,
                                        channel->wr_buf_size,
@@ -934,7 +934,7 @@ static ssize_t xillybus_read(struct file *filp, char *userbuf, size_t count,
 
                        if (bufferdone) {
                                channel->endpoint->ephw->
-                                       sync_single_for_device
+                                       hw_sync_sgl_for_device
                                        (
                                                channel->endpoint,
                                                channel->wr_buffers[bufidx]->
@@ -1243,7 +1243,7 @@ static int xillybus_myflush(struct xilly_channel *channel, long timeout)
                else
                        channel->rd_host_buf_idx++;
 
-               channel->endpoint->ephw->sync_single_for_device(
+               channel->endpoint->ephw->hw_sync_sgl_for_device(
                        channel->endpoint,
                        channel->rd_buffers[bufidx]->dma_addr,
                        channel->rd_buf_size,
@@ -1362,7 +1362,7 @@ static void xillybus_autoflush(struct work_struct *work)
 
 }
 
-static ssize_t xillybus_write(struct file *filp, const char *userbuf,
+static ssize_t xillybus_write(struct file *filp, const char __user *userbuf,
                              size_t count, loff_t *f_pos)
 {
        ssize_t rc;
@@ -1471,7 +1471,7 @@ static ssize_t xillybus_write(struct file *filp, const char *userbuf,
 
                        if ((bufpos == 0) || /* Zero means it's virgin */
                            (channel->rd_leftovers[3] != 0)) {
-                               channel->endpoint->ephw->sync_single_for_cpu(
+                               channel->endpoint->ephw->hw_sync_sgl_for_cpu(
                                        channel->endpoint,
                                        channel->rd_buffers[bufidx]->dma_addr,
                                        channel->rd_buf_size,
@@ -1494,7 +1494,7 @@ static ssize_t xillybus_write(struct file *filp, const char *userbuf,
 
                        if (bufferdone) {
                                channel->endpoint->ephw->
-                                       sync_single_for_device(
+                                       hw_sync_sgl_for_device(
                                                channel->endpoint,
                                                channel->rd_buffers[bufidx]->
                                                dma_addr,
@@ -1867,7 +1867,7 @@ static int xillybus_release(struct inode *inode, struct file *filp)
 
        return 0;
 }
-loff_t xillybus_llseek(struct file *filp, loff_t offset, int whence)
+static loff_t xillybus_llseek(struct file *filp, loff_t offset, int whence)
 {
        struct xilly_channel *channel = filp->private_data;
        loff_t pos = filp->f_pos;
index 122d9ba1b28b09d2b2a7d6c6e21ba3c13fb685b5..92c2931f434840435a90327e6d7e66c30dde6ad4 100644 (file)
@@ -85,7 +85,7 @@ static dma_addr_t xilly_map_single_of(struct xilly_cleanup *mem,
        return addr;
 }
 
-void xilly_unmap_single_of(struct xilly_dma *entry)
+static void xilly_unmap_single_of(struct xilly_dma *entry)
 {
        dma_unmap_single(entry->dev,
                         entry->dma_addr,
@@ -95,8 +95,8 @@ void xilly_unmap_single_of(struct xilly_dma *entry)
 
 static struct xilly_endpoint_hardware of_hw = {
        .owner = THIS_MODULE,
-       .sync_single_for_cpu = xilly_dma_sync_single_for_cpu_of,
-       .sync_single_for_device = xilly_dma_sync_single_for_device_of,
+       .hw_sync_sgl_for_cpu = xilly_dma_sync_single_for_cpu_of,
+       .hw_sync_sgl_for_device = xilly_dma_sync_single_for_device_of,
        .map_single = xilly_map_single_of,
        .unmap_single = xilly_unmap_single_of
 };
index ad45bdb2a715a540670c995e6d1779749c35256e..67013652358b905039bbfae37791cb721baf7352 100644 (file)
@@ -112,7 +112,7 @@ static dma_addr_t xilly_map_single_pci(struct xilly_cleanup *mem,
        return addr;
 }
 
-void xilly_unmap_single_pci(struct xilly_dma *entry)
+static void xilly_unmap_single_pci(struct xilly_dma *entry)
 {
        pci_unmap_single(entry->pdev,
                         entry->dma_addr,
@@ -122,8 +122,8 @@ void xilly_unmap_single_pci(struct xilly_dma *entry)
 
 static struct xilly_endpoint_hardware pci_hw = {
        .owner = THIS_MODULE,
-       .sync_single_for_cpu = xilly_dma_sync_single_for_cpu_pci,
-       .sync_single_for_device = xilly_dma_sync_single_for_device_pci,
+       .hw_sync_sgl_for_cpu = xilly_dma_sync_single_for_cpu_pci,
+       .hw_sync_sgl_for_device = xilly_dma_sync_single_for_device_pci,
        .map_single = xilly_map_single_pci,
        .unmap_single = xilly_unmap_single_pci
 };