diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/ide/ide-probe.c | 1 | ||||
-rw-r--r-- | drivers/infiniband/hw/ehca/ehca_mrmw.c | 6 | ||||
-rw-r--r-- | drivers/parisc/ccio-dma.c | 1 | ||||
-rw-r--r-- | drivers/parisc/sba_iommu.c | 1 | ||||
-rw-r--r-- | drivers/pci/intel-iommu.c | 4 | ||||
-rw-r--r-- | drivers/s390/scsi/zfcp_aux.c | 1 | ||||
-rw-r--r-- | drivers/s390/scsi/zfcp_def.h | 4 | ||||
-rw-r--r-- | drivers/s390/scsi/zfcp_erp.c | 10 | ||||
-rw-r--r-- | drivers/scsi/ps3rom.c | 2 |
9 files changed, 18 insertions, 12 deletions
diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c index ec55a173c08a..6a6f2e066b46 100644 --- a/drivers/ide/ide-probe.c +++ b/drivers/ide/ide-probe.c | |||
@@ -47,6 +47,7 @@ | |||
47 | #include <linux/spinlock.h> | 47 | #include <linux/spinlock.h> |
48 | #include <linux/kmod.h> | 48 | #include <linux/kmod.h> |
49 | #include <linux/pci.h> | 49 | #include <linux/pci.h> |
50 | #include <linux/scatterlist.h> | ||
50 | 51 | ||
51 | #include <asm/byteorder.h> | 52 | #include <asm/byteorder.h> |
52 | #include <asm/irq.h> | 53 | #include <asm/irq.h> |
diff --git a/drivers/infiniband/hw/ehca/ehca_mrmw.c b/drivers/infiniband/hw/ehca/ehca_mrmw.c index da88738265ed..ead7230d7738 100644 --- a/drivers/infiniband/hw/ehca/ehca_mrmw.c +++ b/drivers/infiniband/hw/ehca/ehca_mrmw.c | |||
@@ -1776,7 +1776,7 @@ static int ehca_set_pagebuf_user1(struct ehca_mr_pginfo *pginfo, | |||
1776 | list_for_each_entry_continue( | 1776 | list_for_each_entry_continue( |
1777 | chunk, (&(pginfo->u.usr.region->chunk_list)), list) { | 1777 | chunk, (&(pginfo->u.usr.region->chunk_list)), list) { |
1778 | for (i = pginfo->u.usr.next_nmap; i < chunk->nmap; ) { | 1778 | for (i = pginfo->u.usr.next_nmap; i < chunk->nmap; ) { |
1779 | pgaddr = page_to_pfn(chunk->page_list[i].page) | 1779 | pgaddr = page_to_pfn(sg_page(&chunk->page_list[i])) |
1780 | << PAGE_SHIFT ; | 1780 | << PAGE_SHIFT ; |
1781 | *kpage = phys_to_abs(pgaddr + | 1781 | *kpage = phys_to_abs(pgaddr + |
1782 | (pginfo->next_hwpage * | 1782 | (pginfo->next_hwpage * |
@@ -1832,7 +1832,7 @@ static int ehca_check_kpages_per_ate(struct scatterlist *page_list, | |||
1832 | { | 1832 | { |
1833 | int t; | 1833 | int t; |
1834 | for (t = start_idx; t <= end_idx; t++) { | 1834 | for (t = start_idx; t <= end_idx; t++) { |
1835 | u64 pgaddr = page_to_pfn(page_list[t].page) << PAGE_SHIFT; | 1835 | u64 pgaddr = page_to_pfn(sg_page(&page_list[t])) << PAGE_SHIFT; |
1836 | ehca_gen_dbg("chunk_page=%lx value=%016lx", pgaddr, | 1836 | ehca_gen_dbg("chunk_page=%lx value=%016lx", pgaddr, |
1837 | *(u64 *)abs_to_virt(phys_to_abs(pgaddr))); | 1837 | *(u64 *)abs_to_virt(phys_to_abs(pgaddr))); |
1838 | if (pgaddr - PAGE_SIZE != *prev_pgaddr) { | 1838 | if (pgaddr - PAGE_SIZE != *prev_pgaddr) { |
@@ -1867,7 +1867,7 @@ static int ehca_set_pagebuf_user2(struct ehca_mr_pginfo *pginfo, | |||
1867 | chunk, (&(pginfo->u.usr.region->chunk_list)), list) { | 1867 | chunk, (&(pginfo->u.usr.region->chunk_list)), list) { |
1868 | for (i = pginfo->u.usr.next_nmap; i < chunk->nmap; ) { | 1868 | for (i = pginfo->u.usr.next_nmap; i < chunk->nmap; ) { |
1869 | if (nr_kpages == kpages_per_hwpage) { | 1869 | if (nr_kpages == kpages_per_hwpage) { |
1870 | pgaddr = ( page_to_pfn(chunk->page_list[i].page) | 1870 | pgaddr = ( page_to_pfn(sg_page(&chunk->page_list[i])) |
1871 | << PAGE_SHIFT ); | 1871 | << PAGE_SHIFT ); |
1872 | *kpage = phys_to_abs(pgaddr); | 1872 | *kpage = phys_to_abs(pgaddr); |
1873 | if ( !(*kpage) ) { | 1873 | if ( !(*kpage) ) { |
diff --git a/drivers/parisc/ccio-dma.c b/drivers/parisc/ccio-dma.c index b3c4dbff26b8..7c60cbd85dc8 100644 --- a/drivers/parisc/ccio-dma.c +++ b/drivers/parisc/ccio-dma.c | |||
@@ -42,6 +42,7 @@ | |||
42 | #include <linux/reboot.h> | 42 | #include <linux/reboot.h> |
43 | #include <linux/proc_fs.h> | 43 | #include <linux/proc_fs.h> |
44 | #include <linux/seq_file.h> | 44 | #include <linux/seq_file.h> |
45 | #include <linux/scatterlist.h> | ||
45 | 46 | ||
46 | #include <asm/byteorder.h> | 47 | #include <asm/byteorder.h> |
47 | #include <asm/cache.h> /* for L1_CACHE_BYTES */ | 48 | #include <asm/cache.h> /* for L1_CACHE_BYTES */ |
diff --git a/drivers/parisc/sba_iommu.c b/drivers/parisc/sba_iommu.c index e5c323936eae..e527a0e1d6c0 100644 --- a/drivers/parisc/sba_iommu.c +++ b/drivers/parisc/sba_iommu.c | |||
@@ -28,6 +28,7 @@ | |||
28 | #include <linux/mm.h> | 28 | #include <linux/mm.h> |
29 | #include <linux/string.h> | 29 | #include <linux/string.h> |
30 | #include <linux/pci.h> | 30 | #include <linux/pci.h> |
31 | #include <linux/scatterlist.h> | ||
31 | 32 | ||
32 | #include <asm/byteorder.h> | 33 | #include <asm/byteorder.h> |
33 | #include <asm/io.h> | 34 | #include <asm/io.h> |
diff --git a/drivers/pci/intel-iommu.c b/drivers/pci/intel-iommu.c index b3d70310af49..0c4ab3b07274 100644 --- a/drivers/pci/intel-iommu.c +++ b/drivers/pci/intel-iommu.c | |||
@@ -1962,7 +1962,7 @@ static void intel_free_coherent(struct device *hwdev, size_t size, | |||
1962 | free_pages((unsigned long)vaddr, order); | 1962 | free_pages((unsigned long)vaddr, order); |
1963 | } | 1963 | } |
1964 | 1964 | ||
1965 | #define SG_ENT_VIRT_ADDRESS(sg) (page_address((sg)->page) + (sg)->offset) | 1965 | #define SG_ENT_VIRT_ADDRESS(sg) (sg_virt((sg))) |
1966 | static void intel_unmap_sg(struct device *hwdev, struct scatterlist *sglist, | 1966 | static void intel_unmap_sg(struct device *hwdev, struct scatterlist *sglist, |
1967 | int nelems, int dir) | 1967 | int nelems, int dir) |
1968 | { | 1968 | { |
@@ -2010,7 +2010,7 @@ static int intel_nontranslate_map_sg(struct device *hddev, | |||
2010 | struct scatterlist *sg; | 2010 | struct scatterlist *sg; |
2011 | 2011 | ||
2012 | for_each_sg(sglist, sg, nelems, i) { | 2012 | for_each_sg(sglist, sg, nelems, i) { |
2013 | BUG_ON(!sg->page); | 2013 | BUG_ON(!sg_page(sg)); |
2014 | sg->dma_address = virt_to_bus(SG_ENT_VIRT_ADDRESS(sg)); | 2014 | sg->dma_address = virt_to_bus(SG_ENT_VIRT_ADDRESS(sg)); |
2015 | sg->dma_length = sg->length; | 2015 | sg->dma_length = sg->length; |
2016 | } | 2016 | } |
diff --git a/drivers/s390/scsi/zfcp_aux.c b/drivers/s390/scsi/zfcp_aux.c index 7507067351bd..fd5d0c1570df 100644 --- a/drivers/s390/scsi/zfcp_aux.c +++ b/drivers/s390/scsi/zfcp_aux.c | |||
@@ -559,6 +559,7 @@ zfcp_sg_list_alloc(struct zfcp_sg_list *sg_list, size_t size) | |||
559 | retval = -ENOMEM; | 559 | retval = -ENOMEM; |
560 | goto out; | 560 | goto out; |
561 | } | 561 | } |
562 | sg_init_table(sg_list->sg, sg_list->count); | ||
562 | 563 | ||
563 | for (i = 0, sg = sg_list->sg; i < sg_list->count; i++, sg++) { | 564 | for (i = 0, sg = sg_list->sg; i < sg_list->count; i++, sg++) { |
564 | sg->length = min(size, PAGE_SIZE); | 565 | sg->length = min(size, PAGE_SIZE); |
diff --git a/drivers/s390/scsi/zfcp_def.h b/drivers/s390/scsi/zfcp_def.h index 57cac7008e0b..326e7ee232cb 100644 --- a/drivers/s390/scsi/zfcp_def.h +++ b/drivers/s390/scsi/zfcp_def.h | |||
@@ -63,7 +63,7 @@ | |||
63 | static inline void * | 63 | static inline void * |
64 | zfcp_sg_to_address(struct scatterlist *list) | 64 | zfcp_sg_to_address(struct scatterlist *list) |
65 | { | 65 | { |
66 | return (void *) (page_address(list->page) + list->offset); | 66 | return sg_virt(list); |
67 | } | 67 | } |
68 | 68 | ||
69 | /** | 69 | /** |
@@ -74,7 +74,7 @@ zfcp_sg_to_address(struct scatterlist *list) | |||
74 | static inline void | 74 | static inline void |
75 | zfcp_address_to_sg(void *address, struct scatterlist *list) | 75 | zfcp_address_to_sg(void *address, struct scatterlist *list) |
76 | { | 76 | { |
77 | list->page = virt_to_page(address); | 77 | sg_set_page(list, virt_to_page(address)); |
78 | list->offset = ((unsigned long) address) & (PAGE_SIZE - 1); | 78 | list->offset = ((unsigned long) address) & (PAGE_SIZE - 1); |
79 | } | 79 | } |
80 | 80 | ||
diff --git a/drivers/s390/scsi/zfcp_erp.c b/drivers/s390/scsi/zfcp_erp.c index a6475a2bb8a7..9438d0b28799 100644 --- a/drivers/s390/scsi/zfcp_erp.c +++ b/drivers/s390/scsi/zfcp_erp.c | |||
@@ -308,13 +308,15 @@ zfcp_erp_adisc(struct zfcp_port *port) | |||
308 | if (send_els == NULL) | 308 | if (send_els == NULL) |
309 | goto nomem; | 309 | goto nomem; |
310 | 310 | ||
311 | send_els->req = kzalloc(sizeof(struct scatterlist), GFP_ATOMIC); | 311 | send_els->req = kmalloc(sizeof(struct scatterlist), GFP_ATOMIC); |
312 | if (send_els->req == NULL) | 312 | if (send_els->req == NULL) |
313 | goto nomem; | 313 | goto nomem; |
314 | sg_init_table(send_els->req, 1); | ||
314 | 315 | ||
315 | send_els->resp = kzalloc(sizeof(struct scatterlist), GFP_ATOMIC); | 316 | send_els->resp = kmalloc(sizeof(struct scatterlist), GFP_ATOMIC); |
316 | if (send_els->resp == NULL) | 317 | if (send_els->resp == NULL) |
317 | goto nomem; | 318 | goto nomem; |
319 | sg_init_table(send_els->resp, 1); | ||
318 | 320 | ||
319 | address = (void *) get_zeroed_page(GFP_ATOMIC); | 321 | address = (void *) get_zeroed_page(GFP_ATOMIC); |
320 | if (address == NULL) | 322 | if (address == NULL) |
@@ -363,7 +365,7 @@ zfcp_erp_adisc(struct zfcp_port *port) | |||
363 | retval = -ENOMEM; | 365 | retval = -ENOMEM; |
364 | freemem: | 366 | freemem: |
365 | if (address != NULL) | 367 | if (address != NULL) |
366 | __free_pages(send_els->req->page, 0); | 368 | __free_pages(sg_page(send_els->req), 0); |
367 | if (send_els != NULL) { | 369 | if (send_els != NULL) { |
368 | kfree(send_els->req); | 370 | kfree(send_els->req); |
369 | kfree(send_els->resp); | 371 | kfree(send_els->resp); |
@@ -437,7 +439,7 @@ zfcp_erp_adisc_handler(unsigned long data) | |||
437 | 439 | ||
438 | out: | 440 | out: |
439 | zfcp_port_put(port); | 441 | zfcp_port_put(port); |
440 | __free_pages(send_els->req->page, 0); | 442 | __free_pages(sg_page(send_els->req), 0); |
441 | kfree(send_els->req); | 443 | kfree(send_els->req); |
442 | kfree(send_els->resp); | 444 | kfree(send_els->resp); |
443 | kfree(send_els); | 445 | kfree(send_els); |
diff --git a/drivers/scsi/ps3rom.c b/drivers/scsi/ps3rom.c index 03f19b8d19c9..17b4a7c4618c 100644 --- a/drivers/scsi/ps3rom.c +++ b/drivers/scsi/ps3rom.c | |||
@@ -147,7 +147,7 @@ static int fetch_to_dev_buffer(struct scsi_cmnd *cmd, void *buf) | |||
147 | 147 | ||
148 | req_len = fin = 0; | 148 | req_len = fin = 0; |
149 | scsi_for_each_sg(cmd, sgpnt, scsi_sg_count(cmd), k) { | 149 | scsi_for_each_sg(cmd, sgpnt, scsi_sg_count(cmd), k) { |
150 | kaddr = kmap_atomic(sg_page(sgpnt->page), KM_IRQ0); | 150 | kaddr = kmap_atomic(sg_page(sgpnt), KM_IRQ0); |
151 | len = sgpnt->length; | 151 | len = sgpnt->length; |
152 | if ((req_len + len) > buflen) { | 152 | if ((req_len + len) > buflen) { |
153 | len = buflen - req_len; | 153 | len = buflen - req_len; |