aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Ott <sebott@linux.vnet.ibm.com>2016-01-22 08:11:21 -0500
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2016-01-26 06:46:45 -0500
commitf5e44f82c1848d8e55fb0061308f14c0884e5483 (patch)
treeba74ab56d98031e9fc83e154b8691b5900321d6f
parent8ead7efb6379354d0d31efb39342f4399c87cb67 (diff)
s390/pci: remove iomap sanity checks
Since each iomap_entry handles only one bar of one pci function (even when disjunct ranges of a bar are mapped) the sanity check in pci_iomap_range is not needed and can be removed. Also convert the remaining BUG_ONs to WARN_ONs. Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com> Reviewed-by: Gerald Schaefer <gerald.schaefer@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
-rw-r--r--arch/s390/pci/pci.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/arch/s390/pci/pci.c b/arch/s390/pci/pci.c
index d28d194d580c..8f19c8f9d660 100644
--- a/arch/s390/pci/pci.c
+++ b/arch/s390/pci/pci.c
@@ -275,15 +275,10 @@ void __iomem *pci_iomap_range(struct pci_dev *pdev,
275 275
276 idx = zdev->bars[bar].map_idx; 276 idx = zdev->bars[bar].map_idx;
277 spin_lock(&zpci_iomap_lock); 277 spin_lock(&zpci_iomap_lock);
278 if (zpci_iomap_start[idx].count++) {
279 BUG_ON(zpci_iomap_start[idx].fh != zdev->fh ||
280 zpci_iomap_start[idx].bar != bar);
281 } else {
282 zpci_iomap_start[idx].fh = zdev->fh;
283 zpci_iomap_start[idx].bar = bar;
284 }
285 /* Detect overrun */ 278 /* Detect overrun */
286 BUG_ON(!zpci_iomap_start[idx].count); 279 WARN_ON(!++zpci_iomap_start[idx].count);
280 zpci_iomap_start[idx].fh = zdev->fh;
281 zpci_iomap_start[idx].bar = bar;
287 spin_unlock(&zpci_iomap_lock); 282 spin_unlock(&zpci_iomap_lock);
288 283
289 return (void __iomem *) ZPCI_ADDR(idx) + offset; 284 return (void __iomem *) ZPCI_ADDR(idx) + offset;
@@ -302,7 +297,7 @@ void pci_iounmap(struct pci_dev *pdev, void __iomem *addr)
302 297
303 spin_lock(&zpci_iomap_lock); 298 spin_lock(&zpci_iomap_lock);
304 /* Detect underrun */ 299 /* Detect underrun */
305 BUG_ON(!zpci_iomap_start[idx].count); 300 WARN_ON(!zpci_iomap_start[idx].count);
306 if (!--zpci_iomap_start[idx].count) { 301 if (!--zpci_iomap_start[idx].count) {
307 zpci_iomap_start[idx].fh = 0; 302 zpci_iomap_start[idx].fh = 0;
308 zpci_iomap_start[idx].bar = 0; 303 zpci_iomap_start[idx].bar = 0;