Commit c8d1f4b7 authored by Markus Elfring's avatar Markus Elfring Committed by Nicholas Bellinger

target: tcm_loop: Combine substrings for 26 messages

The script "checkpatch.pl" pointed information out like the following.

WARNING: quoted string split across lines

Thus fix the affected source code places.
Signed-off-by: default avatarMarkus Elfring <elfring@users.sourceforge.net>
Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
parent a572dba9
...@@ -123,8 +123,8 @@ static void tcm_loop_submission_work(struct work_struct *work) ...@@ -123,8 +123,8 @@ static void tcm_loop_submission_work(struct work_struct *work)
} }
tl_nexus = tl_tpg->tl_nexus; tl_nexus = tl_tpg->tl_nexus;
if (!tl_nexus) { if (!tl_nexus) {
scmd_printk(KERN_ERR, sc, "TCM_Loop I_T Nexus" scmd_printk(KERN_ERR, sc,
" does not exist\n"); "TCM_Loop I_T Nexus does not exist\n");
set_host_byte(sc, DID_ERROR); set_host_byte(sc, DID_ERROR);
goto out_done; goto out_done;
} }
...@@ -177,10 +177,10 @@ static int tcm_loop_queuecommand(struct Scsi_Host *sh, struct scsi_cmnd *sc) ...@@ -177,10 +177,10 @@ static int tcm_loop_queuecommand(struct Scsi_Host *sh, struct scsi_cmnd *sc)
{ {
struct tcm_loop_cmd *tl_cmd; struct tcm_loop_cmd *tl_cmd;
pr_debug("tcm_loop_queuecommand() %d:%d:%d:%llu got CDB: 0x%02x" pr_debug("%s() %d:%d:%d:%llu got CDB: 0x%02x scsi_buf_len: %u\n",
" scsi_buf_len: %u\n", sc->device->host->host_no, __func__, sc->device->host->host_no, sc->device->id,
sc->device->id, sc->device->channel, sc->device->lun, sc->device->channel, sc->device->lun, sc->cmnd[0],
sc->cmnd[0], scsi_bufflen(sc)); scsi_bufflen(sc));
tl_cmd = kmem_cache_zalloc(tcm_loop_cmd_cache, GFP_ATOMIC); tl_cmd = kmem_cache_zalloc(tcm_loop_cmd_cache, GFP_ATOMIC);
if (!tl_cmd) { if (!tl_cmd) {
...@@ -214,8 +214,7 @@ static int tcm_loop_issue_tmr(struct tcm_loop_tpg *tl_tpg, ...@@ -214,8 +214,7 @@ static int tcm_loop_issue_tmr(struct tcm_loop_tpg *tl_tpg,
*/ */
tl_nexus = tl_tpg->tl_nexus; tl_nexus = tl_tpg->tl_nexus;
if (!tl_nexus) { if (!tl_nexus) {
pr_err("Unable to perform device reset without" pr_err("Unable to perform device reset without active I_T Nexus\n");
" active I_T Nexus\n");
return ret; return ret;
} }
...@@ -295,8 +294,7 @@ static int tcm_loop_target_reset(struct scsi_cmnd *sc) ...@@ -295,8 +294,7 @@ static int tcm_loop_target_reset(struct scsi_cmnd *sc)
*/ */
tl_hba = *(struct tcm_loop_hba **)shost_priv(sc->device->host); tl_hba = *(struct tcm_loop_hba **)shost_priv(sc->device->host);
if (!tl_hba) { if (!tl_hba) {
pr_err("Unable to perform device reset without" pr_err("Unable to perform device reset without active I_T Nexus\n");
" active I_T Nexus\n");
return FAILED; return FAILED;
} }
/* /*
...@@ -414,8 +412,7 @@ static int tcm_loop_setup_hba_bus(struct tcm_loop_hba *tl_hba, int tcm_loop_host ...@@ -414,8 +412,7 @@ static int tcm_loop_setup_hba_bus(struct tcm_loop_hba *tl_hba, int tcm_loop_host
ret = device_register(&tl_hba->dev); ret = device_register(&tl_hba->dev);
if (ret) { if (ret) {
pr_err("device_register() failed for" pr_err("device_register() failed for tl_hba->dev: %d\n", ret);
" tl_hba->dev: %d\n", ret);
return -ENODEV; return -ENODEV;
} }
...@@ -444,8 +441,7 @@ static int tcm_loop_alloc_core_bus(void) ...@@ -444,8 +441,7 @@ static int tcm_loop_alloc_core_bus(void)
ret = driver_register(&tcm_loop_driverfs); ret = driver_register(&tcm_loop_driverfs);
if (ret) { if (ret) {
pr_err("driver_register() failed for" pr_err("driver_register() failed for tcm_loop_driverfs\n");
"tcm_loop_driverfs\n");
goto bus_unreg; goto bus_unreg;
} }
...@@ -584,8 +580,8 @@ static int tcm_loop_queue_data_in(struct se_cmd *se_cmd) ...@@ -584,8 +580,8 @@ static int tcm_loop_queue_data_in(struct se_cmd *se_cmd)
struct tcm_loop_cmd, tl_se_cmd); struct tcm_loop_cmd, tl_se_cmd);
struct scsi_cmnd *sc = tl_cmd->sc; struct scsi_cmnd *sc = tl_cmd->sc;
pr_debug("tcm_loop_queue_data_in() called for scsi_cmnd: %p" pr_debug("%s() called for scsi_cmnd: %p cdb: 0x%02x\n",
" cdb: 0x%02x\n", sc, sc->cmnd[0]); __func__, sc, sc->cmnd[0]);
sc->result = SAM_STAT_GOOD; sc->result = SAM_STAT_GOOD;
set_host_byte(sc, DID_OK); set_host_byte(sc, DID_OK);
...@@ -602,8 +598,8 @@ static int tcm_loop_queue_status(struct se_cmd *se_cmd) ...@@ -602,8 +598,8 @@ static int tcm_loop_queue_status(struct se_cmd *se_cmd)
struct tcm_loop_cmd, tl_se_cmd); struct tcm_loop_cmd, tl_se_cmd);
struct scsi_cmnd *sc = tl_cmd->sc; struct scsi_cmnd *sc = tl_cmd->sc;
pr_debug("tcm_loop_queue_status() called for scsi_cmnd: %p" pr_debug("%s() called for scsi_cmnd: %p cdb: 0x%02x\n",
" cdb: 0x%02x\n", sc, sc->cmnd[0]); __func__, sc, sc->cmnd[0]);
if (se_cmd->sense_buffer && if (se_cmd->sense_buffer &&
((se_cmd->se_cmd_flags & SCF_TRANSPORT_TASK_SENSE) || ((se_cmd->se_cmd_flags & SCF_TRANSPORT_TASK_SENSE) ||
...@@ -688,8 +684,8 @@ static void tcm_loop_port_unlink( ...@@ -688,8 +684,8 @@ static void tcm_loop_port_unlink(
sd = scsi_device_lookup(tl_hba->sh, 0, tl_tpg->tl_tpgt, sd = scsi_device_lookup(tl_hba->sh, 0, tl_tpg->tl_tpgt,
se_lun->unpacked_lun); se_lun->unpacked_lun);
if (!sd) { if (!sd) {
pr_err("Unable to locate struct scsi_device for %d:%d:" pr_err("Unable to locate struct scsi_device for %d:%d:%llu\n",
"%llu\n", 0, tl_tpg->tl_tpgt, se_lun->unpacked_lun); 0, tl_tpg->tl_tpgt, se_lun->unpacked_lun);
return; return;
} }
/* /*
...@@ -782,9 +778,8 @@ static int tcm_loop_make_nexus( ...@@ -782,9 +778,8 @@ static int tcm_loop_make_nexus(
return ret; return ret;
} }
pr_debug("TCM_Loop_ConfigFS: Established I_T Nexus to emulated" pr_debug("TCM_Loop_ConfigFS: Established I_T Nexus to emulated %s Initiator Port: %s\n",
" %s Initiator Port: %s\n", tcm_loop_dump_proto_id(tl_hba), tcm_loop_dump_proto_id(tl_hba), name);
name);
return 0; return 0;
} }
...@@ -803,15 +798,14 @@ static int tcm_loop_drop_nexus( ...@@ -803,15 +798,14 @@ static int tcm_loop_drop_nexus(
return -ENODEV; return -ENODEV;
if (atomic_read(&tpg->tl_tpg_port_count)) { if (atomic_read(&tpg->tl_tpg_port_count)) {
pr_err("Unable to remove TCM_Loop I_T Nexus with" pr_err("Unable to remove TCM_Loop I_T Nexus with active TPG port count: %d\n",
" active TPG port count: %d\n", atomic_read(&tpg->tl_tpg_port_count));
atomic_read(&tpg->tl_tpg_port_count));
return -EPERM; return -EPERM;
} }
pr_debug("TCM_Loop_ConfigFS: Removing I_T Nexus to emulated" pr_debug("TCM_Loop_ConfigFS: Removing I_T Nexus to emulated %s Initiator Port: %s\n",
" %s Initiator Port: %s\n", tcm_loop_dump_proto_id(tpg->tl_hba), tcm_loop_dump_proto_id(tpg->tl_hba),
tl_nexus->se_sess->se_node_acl->initiatorname); tl_nexus->se_sess->se_node_acl->initiatorname);
/* /*
* Release the SCSI I_T Nexus to the emulated Target Port * Release the SCSI I_T Nexus to the emulated Target Port
*/ */
...@@ -863,8 +857,8 @@ static ssize_t tcm_loop_tpg_nexus_store(struct config_item *item, ...@@ -863,8 +857,8 @@ static ssize_t tcm_loop_tpg_nexus_store(struct config_item *item,
* tcm_loop_make_nexus() * tcm_loop_make_nexus()
*/ */
if (strlen(page) >= TL_WWN_ADDR_LEN) { if (strlen(page) >= TL_WWN_ADDR_LEN) {
pr_err("Emulated NAA Sas Address: %s, exceeds" pr_err("Emulated NAA Sas Address: %s, exceeds max: %d\n",
" max: %d\n", page, TL_WWN_ADDR_LEN); page, TL_WWN_ADDR_LEN);
return -EINVAL; return -EINVAL;
} }
snprintf(&i_port[0], TL_WWN_ADDR_LEN, "%s", page); snprintf(&i_port[0], TL_WWN_ADDR_LEN, "%s", page);
...@@ -872,9 +866,8 @@ static ssize_t tcm_loop_tpg_nexus_store(struct config_item *item, ...@@ -872,9 +866,8 @@ static ssize_t tcm_loop_tpg_nexus_store(struct config_item *item,
ptr = strstr(i_port, "naa."); ptr = strstr(i_port, "naa.");
if (ptr) { if (ptr) {
if (tl_hba->tl_proto_id != SCSI_PROTOCOL_SAS) { if (tl_hba->tl_proto_id != SCSI_PROTOCOL_SAS) {
pr_err("Passed SAS Initiator Port %s does not" pr_err("Passed SAS Initiator Port %s does not match target port protoid: %s\n",
" match target port protoid: %s\n", i_port, i_port, tcm_loop_dump_proto_id(tl_hba));
tcm_loop_dump_proto_id(tl_hba));
return -EINVAL; return -EINVAL;
} }
port_ptr = &i_port[0]; port_ptr = &i_port[0];
...@@ -883,9 +876,8 @@ static ssize_t tcm_loop_tpg_nexus_store(struct config_item *item, ...@@ -883,9 +876,8 @@ static ssize_t tcm_loop_tpg_nexus_store(struct config_item *item,
ptr = strstr(i_port, "fc."); ptr = strstr(i_port, "fc.");
if (ptr) { if (ptr) {
if (tl_hba->tl_proto_id != SCSI_PROTOCOL_FCP) { if (tl_hba->tl_proto_id != SCSI_PROTOCOL_FCP) {
pr_err("Passed FCP Initiator Port %s does not" pr_err("Passed FCP Initiator Port %s does not match target port protoid: %s\n",
" match target port protoid: %s\n", i_port, i_port, tcm_loop_dump_proto_id(tl_hba));
tcm_loop_dump_proto_id(tl_hba));
return -EINVAL; return -EINVAL;
} }
port_ptr = &i_port[3]; /* Skip over "fc." */ port_ptr = &i_port[3]; /* Skip over "fc." */
...@@ -894,16 +886,15 @@ static ssize_t tcm_loop_tpg_nexus_store(struct config_item *item, ...@@ -894,16 +886,15 @@ static ssize_t tcm_loop_tpg_nexus_store(struct config_item *item,
ptr = strstr(i_port, "iqn."); ptr = strstr(i_port, "iqn.");
if (ptr) { if (ptr) {
if (tl_hba->tl_proto_id != SCSI_PROTOCOL_ISCSI) { if (tl_hba->tl_proto_id != SCSI_PROTOCOL_ISCSI) {
pr_err("Passed iSCSI Initiator Port %s does not" pr_err("Passed iSCSI Initiator Port %s does not match target port protoid: %s\n",
" match target port protoid: %s\n", i_port, i_port, tcm_loop_dump_proto_id(tl_hba));
tcm_loop_dump_proto_id(tl_hba));
return -EINVAL; return -EINVAL;
} }
port_ptr = &i_port[0]; port_ptr = &i_port[0];
goto check_newline; goto check_newline;
} }
pr_err("Unable to locate prefix for emulated Initiator Port:" pr_err("Unable to locate prefix for emulated Initiator Port: %s\n",
" %s\n", i_port); i_port);
return -EINVAL; return -EINVAL;
/* /*
* Clear any trailing newline for the NAA WWN * Clear any trailing newline for the NAA WWN
...@@ -1005,16 +996,15 @@ static struct se_portal_group *tcm_loop_make_naa_tpg( ...@@ -1005,16 +996,15 @@ static struct se_portal_group *tcm_loop_make_naa_tpg(
unsigned long tpgt; unsigned long tpgt;
if (strstr(name, "tpgt_") != name) { if (strstr(name, "tpgt_") != name) {
pr_err("Unable to locate \"tpgt_#\" directory" pr_err("Unable to locate \"tpgt_#\" directory group\n");
" group\n");
return ERR_PTR(-EINVAL); return ERR_PTR(-EINVAL);
} }
if (kstrtoul(name+5, 10, &tpgt)) if (kstrtoul(name+5, 10, &tpgt))
return ERR_PTR(-EINVAL); return ERR_PTR(-EINVAL);
if (tpgt >= TL_TPGS_PER_HBA) { if (tpgt >= TL_TPGS_PER_HBA) {
pr_err("Passed tpgt: %lu exceeds TL_TPGS_PER_HBA:" pr_err("Passed tpgt: %lu exceeds TL_TPGS_PER_HBA: %u\n",
" %u\n", tpgt, TL_TPGS_PER_HBA); tpgt, TL_TPGS_PER_HBA);
return ERR_PTR(-EINVAL); return ERR_PTR(-EINVAL);
} }
tl_tpg = &tl_hba->tl_hba_tpgs[tpgt]; tl_tpg = &tl_hba->tl_hba_tpgs[tpgt];
...@@ -1027,10 +1017,9 @@ static struct se_portal_group *tcm_loop_make_naa_tpg( ...@@ -1027,10 +1017,9 @@ static struct se_portal_group *tcm_loop_make_naa_tpg(
if (ret < 0) if (ret < 0)
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
pr_debug("TCM_Loop_ConfigFS: Allocated Emulated %s" pr_debug("TCM_Loop_ConfigFS: Allocated Emulated %s Target Port %s,t,0x%04lx\n",
" Target Port %s,t,0x%04lx\n", tcm_loop_dump_proto_id(tl_hba), tcm_loop_dump_proto_id(tl_hba),
config_item_name(&wwn->wwn_group.cg_item), tpgt); config_item_name(&wwn->wwn_group.cg_item), tpgt);
return &tl_tpg->tl_se_tpg; return &tl_tpg->tl_se_tpg;
} }
...@@ -1057,9 +1046,9 @@ static void tcm_loop_drop_naa_tpg( ...@@ -1057,9 +1046,9 @@ static void tcm_loop_drop_naa_tpg(
tl_tpg->tl_hba = NULL; tl_tpg->tl_hba = NULL;
tl_tpg->tl_tpgt = 0; tl_tpg->tl_tpgt = 0;
pr_debug("TCM_Loop_ConfigFS: Deallocated Emulated %s" pr_debug("TCM_Loop_ConfigFS: Deallocated Emulated %s Target Port %s,t,0x%04x\n",
" Target Port %s,t,0x%04x\n", tcm_loop_dump_proto_id(tl_hba), tcm_loop_dump_proto_id(tl_hba),
config_item_name(&wwn->wwn_group.cg_item), tpgt); config_item_name(&wwn->wwn_group.cg_item), tpgt);
} }
/* End items for tcm_loop_naa_cit */ /* End items for tcm_loop_naa_cit */
...@@ -1097,8 +1086,8 @@ static struct se_wwn *tcm_loop_make_scsi_hba( ...@@ -1097,8 +1086,8 @@ static struct se_wwn *tcm_loop_make_scsi_hba(
} }
ptr = strstr(name, "iqn."); ptr = strstr(name, "iqn.");
if (!ptr) { if (!ptr) {
pr_err("Unable to locate prefix for emulated Target " pr_err("Unable to locate prefix for emulated Target Port: %s\n",
"Port: %s\n", name); name);
ret = -EINVAL; ret = -EINVAL;
goto out; goto out;
} }
...@@ -1106,9 +1095,8 @@ static struct se_wwn *tcm_loop_make_scsi_hba( ...@@ -1106,9 +1095,8 @@ static struct se_wwn *tcm_loop_make_scsi_hba(
check_len: check_len:
if (strlen(name) >= TL_WWN_ADDR_LEN) { if (strlen(name) >= TL_WWN_ADDR_LEN) {
pr_err("Emulated NAA %s Address: %s, exceeds" pr_err("Emulated NAA %s Address: %s, exceeds max: %d\n",
" max: %d\n", name, tcm_loop_dump_proto_id(tl_hba), name, tcm_loop_dump_proto_id(tl_hba), TL_WWN_ADDR_LEN);
TL_WWN_ADDR_LEN);
ret = -EINVAL; ret = -EINVAL;
goto out; goto out;
} }
...@@ -1125,10 +1113,8 @@ static struct se_wwn *tcm_loop_make_scsi_hba( ...@@ -1125,10 +1113,8 @@ static struct se_wwn *tcm_loop_make_scsi_hba(
sh = tl_hba->sh; sh = tl_hba->sh;
tcm_loop_hba_no_cnt++; tcm_loop_hba_no_cnt++;
pr_debug("TCM_Loop_ConfigFS: Allocated emulated Target" pr_debug("TCM_Loop_ConfigFS: Allocated emulated Target %s Address: %s at Linux/SCSI Host ID: %d\n",
" %s Address: %s at Linux/SCSI Host ID: %d\n", tcm_loop_dump_proto_id(tl_hba), name, sh->host_no);
tcm_loop_dump_proto_id(tl_hba), name, sh->host_no);
return &tl_hba->tl_hba_wwn; return &tl_hba->tl_hba_wwn;
out: out:
kfree(tl_hba); kfree(tl_hba);
...@@ -1141,10 +1127,9 @@ static void tcm_loop_drop_scsi_hba( ...@@ -1141,10 +1127,9 @@ static void tcm_loop_drop_scsi_hba(
struct tcm_loop_hba *tl_hba = container_of(wwn, struct tcm_loop_hba *tl_hba = container_of(wwn,
struct tcm_loop_hba, tl_hba_wwn); struct tcm_loop_hba, tl_hba_wwn);
pr_debug("TCM_Loop_ConfigFS: Deallocating emulated Target" pr_debug("TCM_Loop_ConfigFS: Deallocating emulated Target %s Address: %s at Linux/SCSI Host ID: %d\n",
" %s Address: %s at Linux/SCSI Host ID: %d\n", tcm_loop_dump_proto_id(tl_hba), tl_hba->tl_wwn_address,
tcm_loop_dump_proto_id(tl_hba), tl_hba->tl_wwn_address, tl_hba->sh->host_no);
tl_hba->sh->host_no);
/* /*
* Call device_unregister() on the original tl_hba->dev. * Call device_unregister() on the original tl_hba->dev.
* tcm_loop_fabric_scsi.c:tcm_loop_release_adapter() will * tcm_loop_fabric_scsi.c:tcm_loop_release_adapter() will
...@@ -1217,8 +1202,7 @@ static int __init tcm_loop_fabric_init(void) ...@@ -1217,8 +1202,7 @@ static int __init tcm_loop_fabric_init(void)
__alignof__(struct tcm_loop_cmd), __alignof__(struct tcm_loop_cmd),
0, NULL); 0, NULL);
if (!tcm_loop_cmd_cache) { if (!tcm_loop_cmd_cache) {
pr_debug("kmem_cache_create() for" pr_debug("kmem_cache_create() for tcm_loop_cmd_cache failed\n");
" tcm_loop_cmd_cache failed\n");
goto out_destroy_workqueue; goto out_destroy_workqueue;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment