s390/pci: add sparse annotations
authorMartin Schwidefsky <schwidefsky@de.ibm.com>
Thu, 30 Oct 2014 09:30:45 +0000 (10:30 +0100)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Mon, 3 Nov 2014 12:30:23 +0000 (13:30 +0100)
Fix the following warnings from the sparse code checker:

arch/s390/include/asm/pci_io.h:165:49: warning: cast removes address space of expression
arch/s390/pci/pci.c:476:44: warning: cast removes address space of expression
arch/s390/pci/pci.c:491:36: warning: incorrect type in argument 2 (different address spaces)
arch/s390/pci/pci.c:491:36:    expected void [noderef] <asn:2>*addr
arch/s390/pci/pci.c:491:36:    got void *<noident>

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
arch/s390/include/asm/pci_io.h
arch/s390/pci/pci.c

index d194d544d6943df1f39d31087cbe9acdf0fc449c..f664e96f48c7bdb8e4174028546fa4d2ce0eca05 100644 (file)
@@ -139,7 +139,8 @@ static inline int zpci_memcpy_fromio(void *dst,
        int size, rc = 0;
 
        while (n > 0) {
-               size = zpci_get_max_write_size((u64) src, (u64) dst, n, 8);
+               size = zpci_get_max_write_size((u64 __force) src,
+                                              (u64) dst, n, 8);
                req = ZPCI_CREATE_REQ(entry->fh, entry->bar, size);
                rc = zpci_read_single(req, dst, offset, size);
                if (rc)
@@ -162,7 +163,8 @@ static inline int zpci_memcpy_toio(volatile void __iomem *dst,
                return -EINVAL;
 
        while (n > 0) {
-               size = zpci_get_max_write_size((u64) dst, (u64) src, n, 128);
+               size = zpci_get_max_write_size((u64 __force) dst,
+                                              (u64) src, n, 128);
                req = ZPCI_CREATE_REQ(entry->fh, entry->bar, size);
 
                if (size > 8) /* main path */
index 47a4568e141d2407d78c9090726e5fb5e35bd125..ed3725e2d16ece57362c2ab66eed80cf1710188f 100644 (file)
@@ -473,7 +473,8 @@ static void zpci_map_resources(struct zpci_dev *zdev)
                len = pci_resource_len(pdev, i);
                if (!len)
                        continue;
-               pdev->resource[i].start = (resource_size_t) pci_iomap(pdev, i, 0);
+               pdev->resource[i].start =
+                       (resource_size_t __force) pci_iomap(pdev, i, 0);
                pdev->resource[i].end = pdev->resource[i].start + len - 1;
        }
 }
@@ -488,7 +489,8 @@ static void zpci_unmap_resources(struct zpci_dev *zdev)
                len = pci_resource_len(pdev, i);
                if (!len)
                        continue;
-               pci_iounmap(pdev, (void *) pdev->resource[i].start);
+               pci_iounmap(pdev, (void __iomem __force *)
+                           pdev->resource[i].start);
        }
 }