All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] __iomem annotations for cciss
@ 2004-10-03 11:46 Christoph Hellwig
  0 siblings, 0 replies; only message in thread
From: Christoph Hellwig @ 2004-10-03 11:46 UTC (permalink / raw)
  To: mike.miller, iss_storagedev; +Cc: linux-kernel

Also remove the page masking before ioremap, it's not been nessecary for
ages.


--- 1.122/drivers/block/cciss.c	2004-08-23 10:15:28 +02:00
+++ edited/drivers/block/cciss.c	2004-10-02 15:14:22 +02:00
@@ -1841,17 +1841,6 @@
 	cmd_free(info_p, c, 1);
 	return (status);
 } 
-/*
- * Map (physical) PCI mem into (virtual) kernel space
- */
-static ulong remap_pci_mem(ulong base, ulong size)
-{
-        ulong page_base        = ((ulong) base) & PAGE_MASK;
-        ulong page_offs        = ((ulong) base) - page_base;
-        ulong page_remapped    = (ulong) ioremap(page_base, page_offs+size);
-
-        return (ulong) (page_remapped ? (page_remapped + page_offs) : 0UL);
-}
 
 /* 
  * Takes jobs of the Q and sends them to the hardware, then puts it on 
@@ -2369,11 +2358,7 @@
          *   table
 	 */
 
-	c->paddr = pci_resource_start(pdev, 0); /* addressing mode bits already removed */
-#ifdef CCISS_DEBUG
-	printk("address 0 = %x\n", c->paddr);
-#endif /* CCISS_DEBUG */ 
-	c->vaddr = remap_pci_mem(c->paddr, 200);
+	c->vaddr = ioremap(pci_resource_start(pdev, 0), 200);
 
 	/* Wait for the board to become ready.  (PCI hotplug needs this.)
 	 * We poll for up to 120 secs, once per 100ms. */
@@ -2410,8 +2395,7 @@
 #ifdef CCISS_DEBUG
 	printk("cfg offset = %x\n", cfg_offset);
 #endif /* CCISS_DEBUG */
-	c->cfgtable = (CfgTable_struct *) 
-		remap_pci_mem(pci_resource_start(pdev, cfg_base_addr_index)
+	c->cfgtable = ioremap(pci_resource_start(pdev, cfg_base_addr_index)
 				+ cfg_offset, sizeof(CfgTable_struct));
 	c->board_id = board_id;
 
@@ -2824,7 +2808,7 @@
 	}
 	free_irq(hba[i]->intr, hba[i]);
 	pci_set_drvdata(pdev, NULL);
-	iounmap((void*)hba[i]->vaddr);
+	iounmap(hba[i]->vaddr);
 	cciss_unregister_scsi(i);  /* unhook from SCSI subsystem */
 	unregister_blkdev(COMPAQ_CISS_MAJOR+i, hba[i]->devname);
 	remove_proc_entry(hba[i]->devname, proc_cciss);	
--- 1.24/drivers/block/cciss.h	2004-08-23 10:15:28 +02:00
+++ edited/drivers/block/cciss.h	2004-10-02 15:12:53 +02:00
@@ -43,11 +43,10 @@
 	char	firm_ver[4]; // Firmware version 
 	struct pci_dev *pdev;
 	__u32	board_id;
-	unsigned long vaddr;
-	unsigned long paddr;
+	void __iomem *vaddr;
 	unsigned long io_mem_addr;
 	unsigned long io_mem_length;
-	CfgTable_struct *cfgtable;
+	CfgTable_struct __iomem *cfgtable;
 	unsigned int intr;
 	int	interrupts_enabled;
 	int 	max_commands;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-10-03 11:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-10-03 11:46 [PATCH] __iomem annotations for cciss Christoph Hellwig

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.