[PATCH] target: Use char pointers for initiator names

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Initiator names are zero-terminated ASCII strings so use the
data type char * to represent these. Constify the initiator name
argument where appropriate. Remove the casts that became
superfluous due to this change.

Signed-off-by: Bart Van Assche <bart.vanassche@xxxxxxxxxxx>
Cc: Christoph Hellwig <hch@xxxxxx>
Cc: Andy Grover <agrover@xxxxxxxxxx>
Cc: <qla2xxx-upstream@xxxxxxxxxx>
Cc: Felipe Balbi <balbi@xxxxxx>
Cc: Michael S. Tsirkin <mst@xxxxxxxxxx>
Cc: Juergen Gross <jgross@xxxxxxxx>
---
 drivers/scsi/qla2xxx/tcm_qla2xxx.c         | 2 +-
 drivers/target/iscsi/iscsi_target_tpg.c    | 2 +-
 drivers/target/iscsi/iscsi_target_tpg.h    | 2 +-
 drivers/target/loopback/tcm_loop.c         | 2 +-
 drivers/target/target_core_tpg.c           | 6 +++---
 drivers/usb/gadget/legacy/tcm_usb_gadget.c | 2 +-
 drivers/vhost/scsi.c                       | 2 +-
 drivers/xen/xen-scsiback.c                 | 2 +-
 include/target/target_core_fabric.h        | 6 +++---
 9 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/drivers/scsi/qla2xxx/tcm_qla2xxx.c b/drivers/scsi/qla2xxx/tcm_qla2xxx.c
index 1bd3653..164ce7b 100644
--- a/drivers/scsi/qla2xxx/tcm_qla2xxx.c
+++ b/drivers/scsi/qla2xxx/tcm_qla2xxx.c
@@ -1589,7 +1589,7 @@ static int tcm_qla2xxx_check_initiator_node_acl(
 	struct se_node_acl *se_nacl;
 	struct se_session *se_sess;
 	struct qla_tgt_sess *sess = qla_tgt_sess;
-	unsigned char port_name[36];
+	char port_name[36];
 	unsigned long flags;
 	int num_tags = (ha->fw_xcb_count) ? ha->fw_xcb_count :
 		       TCM_QLA2XXX_DEFAULT_TAGS;
diff --git a/drivers/target/iscsi/iscsi_target_tpg.c b/drivers/target/iscsi/iscsi_target_tpg.c
index e8a2408..af0ff05 100644
--- a/drivers/target/iscsi/iscsi_target_tpg.c
+++ b/drivers/target/iscsi/iscsi_target_tpg.c
@@ -595,7 +595,7 @@ int iscsit_tpg_del_network_portal(
 
 int iscsit_tpg_set_initiator_node_queue_depth(
 	struct iscsi_portal_group *tpg,
-	unsigned char *initiatorname,
+	const char *initiatorname,
 	u32 queue_depth,
 	int force)
 {
diff --git a/drivers/target/iscsi/iscsi_target_tpg.h b/drivers/target/iscsi/iscsi_target_tpg.h
index 95ff5bd..56acf99 100644
--- a/drivers/target/iscsi/iscsi_target_tpg.h
+++ b/drivers/target/iscsi/iscsi_target_tpg.h
@@ -27,7 +27,7 @@ extern struct iscsi_tpg_np *iscsit_tpg_add_network_portal(struct iscsi_portal_gr
 extern int iscsit_tpg_del_network_portal(struct iscsi_portal_group *,
 			struct iscsi_tpg_np *);
 extern int iscsit_tpg_set_initiator_node_queue_depth(struct iscsi_portal_group *,
-			unsigned char *, u32, int);
+			const char *, u32, int);
 extern int iscsit_ta_authentication(struct iscsi_portal_group *, u32);
 extern int iscsit_ta_login_timeout(struct iscsi_portal_group *, u32);
 extern int iscsit_ta_netif_timeout(struct iscsi_portal_group *, u32);
diff --git a/drivers/target/loopback/tcm_loop.c b/drivers/target/loopback/tcm_loop.c
index 5b143d2..100c9fc 100644
--- a/drivers/target/loopback/tcm_loop.c
+++ b/drivers/target/loopback/tcm_loop.c
@@ -995,7 +995,7 @@ static int tcm_loop_make_nexus(
 	 * Initiator port name of the passed configfs group 'name'.
 	 */
 	tl_nexus->se_sess->se_node_acl = core_tpg_check_initiator_node_acl(
-				se_tpg, (unsigned char *)name);
+							se_tpg, name);
 	if (!tl_nexus->se_sess->se_node_acl) {
 		transport_free_session(tl_nexus->se_sess);
 		goto out;
diff --git a/drivers/target/target_core_tpg.c b/drivers/target/target_core_tpg.c
index 47f0644..4301a70 100644
--- a/drivers/target/target_core_tpg.c
+++ b/drivers/target/target_core_tpg.c
@@ -107,7 +107,7 @@ struct se_node_acl *__core_tpg_get_initiator_node_acl(
  */
 struct se_node_acl *core_tpg_get_initiator_node_acl(
 	struct se_portal_group *tpg,
-	unsigned char *initiatorname)
+	const char *initiatorname)
 {
 	struct se_node_acl *acl;
 
@@ -260,7 +260,7 @@ static int core_create_device_list_for_node(struct se_node_acl *nacl)
  */
 struct se_node_acl *core_tpg_check_initiator_node_acl(
 	struct se_portal_group *tpg,
-	unsigned char *initiatorname)
+	const char *initiatorname)
 {
 	struct se_node_acl *acl;
 
@@ -512,7 +512,7 @@ EXPORT_SYMBOL(core_tpg_del_initiator_node_acl);
  */
 int core_tpg_set_initiator_node_queue_depth(
 	struct se_portal_group *tpg,
-	unsigned char *initiatorname,
+	const char *initiatorname,
 	u32 queue_depth,
 	int force)
 {
diff --git a/drivers/usb/gadget/legacy/tcm_usb_gadget.c b/drivers/usb/gadget/legacy/tcm_usb_gadget.c
index 7ea2a44c..69e2cd0 100644
--- a/drivers/usb/gadget/legacy/tcm_usb_gadget.c
+++ b/drivers/usb/gadget/legacy/tcm_usb_gadget.c
@@ -1704,7 +1704,7 @@ out:
 	return ret;
 }
 
-static int tcm_usbg_make_nexus(struct usbg_tpg *tpg, char *name)
+static int tcm_usbg_make_nexus(struct usbg_tpg *tpg, const char *name)
 {
 	struct se_portal_group *se_tpg;
 	struct tcm_usbg_nexus *tv_nexus;
diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c
index e8c88b4..5dcb5cc 100644
--- a/drivers/vhost/scsi.c
+++ b/drivers/vhost/scsi.c
@@ -1995,7 +1995,7 @@ static int vhost_scsi_make_nexus(struct vhost_scsi_tpg *tpg,
 	 * the SCSI Initiator port name of the passed configfs group 'name'.
 	 */
 	tv_nexus->tvn_se_sess->se_node_acl = core_tpg_check_initiator_node_acl(
-				se_tpg, (unsigned char *)name);
+							se_tpg, name);
 	if (!tv_nexus->tvn_se_sess->se_node_acl) {
 		mutex_unlock(&tpg->tv_tpg_mutex);
 		pr_debug("core_tpg_check_initiator_node_acl() failed"
diff --git a/drivers/xen/xen-scsiback.c b/drivers/xen/xen-scsiback.c
index f8a1bd7..3283c2b 100644
--- a/drivers/xen/xen-scsiback.c
+++ b/drivers/xen/xen-scsiback.c
@@ -1653,7 +1653,7 @@ static int scsiback_make_nexus(struct scsiback_tpg *tpg,
 	 * the SCSI Initiator port name of the passed configfs group 'name'.
 	 */
 	tv_nexus->tvn_se_sess->se_node_acl = core_tpg_check_initiator_node_acl(
-				se_tpg, (unsigned char *)name);
+							se_tpg, name);
 	if (!tv_nexus->tvn_se_sess->se_node_acl) {
 		mutex_unlock(&tpg->tv_tpg_mutex);
 		pr_debug("core_tpg_check_initiator_node_acl() failed for %s\n",
diff --git a/include/target/target_core_fabric.h b/include/target/target_core_fabric.h
index 17c7f5a..bb6cc0a 100644
--- a/include/target/target_core_fabric.h
+++ b/include/target/target_core_fabric.h
@@ -168,16 +168,16 @@ void	__target_execute_cmd(struct se_cmd *);
 int	transport_lookup_tmr_lun(struct se_cmd *, u32);
 
 struct se_node_acl *core_tpg_get_initiator_node_acl(struct se_portal_group *tpg,
-		unsigned char *);
+		const char *);
 struct se_node_acl *core_tpg_check_initiator_node_acl(struct se_portal_group *,
-		unsigned char *);
+		const char *);
 void	core_tpg_clear_object_luns(struct se_portal_group *);
 struct se_node_acl *core_tpg_add_initiator_node_acl(struct se_portal_group *,
 		struct se_node_acl *, const char *, u32);
 int	core_tpg_del_initiator_node_acl(struct se_portal_group *,
 		struct se_node_acl *, int);
 int	core_tpg_set_initiator_node_queue_depth(struct se_portal_group *,
-		unsigned char *, u32, int);
+		const char *, u32, int);
 int	core_tpg_set_initiator_node_tag(struct se_portal_group *,
 		struct se_node_acl *, const char *);
 int	core_tpg_register(const struct target_core_fabric_ops *,
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe target-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux SCSI]     [Kernel Newbies]     [Linux SCSI Target Infrastructure]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Device Mapper]

  Powered by Linux