summaryrefslogtreecommitdiff
path: root/drivers/s390/scsi/zfcp_aux.c
diff options
context:
space:
mode:
authorSteffen Maier <maier@linux.ibm.com>2018-11-08 17:44:38 +0300
committerMartin K. Petersen <martin.petersen@oracle.com>2018-11-15 23:01:17 +0300
commit58f3ead54752a083be6faaec270b5c4c39105c7e (patch)
treeb54cb89783fefe7f558484bbd17729223dccf28b /drivers/s390/scsi/zfcp_aux.c
parent6be552276e3cc0a04d734dc93cb837e64b6d9e33 (diff)
downloadlinux-58f3ead54752a083be6faaec270b5c4c39105c7e.tar.xz
scsi: zfcp: move SG table helper from aux to fc and make them static
Since commit 663e0890e31c ("[SCSI] zfcp: remove access control tables interface") these helper functions are only used for auto port scan in zfcp_fc.c. Also change them to the corresponding namespace prefix. This is a small cleanup for the miscellaneous catchall compile unit zfcp_aux.c. Signed-off-by: Steffen Maier <maier@linux.ibm.com> Reviewed-by: Benjamin Block <bblock@linux.ibm.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/s390/scsi/zfcp_aux.c')
-rw-r--r--drivers/s390/scsi/zfcp_aux.c44
1 files changed, 1 insertions, 43 deletions
diff --git a/drivers/s390/scsi/zfcp_aux.c b/drivers/s390/scsi/zfcp_aux.c
index e06c3f21e51d..89657146f832 100644
--- a/drivers/s390/scsi/zfcp_aux.c
+++ b/drivers/s390/scsi/zfcp_aux.c
@@ -4,7 +4,7 @@
*
* Module interface and handling of zfcp data structures.
*
- * Copyright IBM Corp. 2002, 2013
+ * Copyright IBM Corp. 2002, 2017
*/
/*
@@ -535,45 +535,3 @@ err_out:
zfcp_ccw_adapter_put(adapter);
return ERR_PTR(retval);
}
-
-/**
- * zfcp_sg_free_table - free memory used by scatterlists
- * @sg: pointer to scatterlist
- * @count: number of scatterlist which are to be free'ed
- * the scatterlist are expected to reference pages always
- */
-void zfcp_sg_free_table(struct scatterlist *sg, int count)
-{
- int i;
-
- for (i = 0; i < count; i++, sg++)
- if (sg)
- free_page((unsigned long) sg_virt(sg));
- else
- break;
-}
-
-/**
- * zfcp_sg_setup_table - init scatterlist and allocate, assign buffers
- * @sg: pointer to struct scatterlist
- * @count: number of scatterlists which should be assigned with buffers
- * of size page
- *
- * Returns: 0 on success, -ENOMEM otherwise
- */
-int zfcp_sg_setup_table(struct scatterlist *sg, int count)
-{
- void *addr;
- int i;
-
- sg_init_table(sg, count);
- for (i = 0; i < count; i++, sg++) {
- addr = (void *) get_zeroed_page(GFP_KERNEL);
- if (!addr) {
- zfcp_sg_free_table(sg, i);
- return -ENOMEM;
- }
- sg_set_buf(sg, addr, PAGE_SIZE);
- }
- return 0;
-}