aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/target/loopback
diff options
context:
space:
mode:
authorJörn Engel <joern@logfs.org>2011-11-23 20:05:51 -0500
committerNicholas Bellinger <nab@linux-iscsi.org>2011-12-14 06:28:07 -0500
commit8359cf43b9dccddeebb0d247146719a14ce6371a (patch)
tree25421cb0e06d878709a826edf8d724ca102ab441 /drivers/target/loopback
parentfeae85644f1460b3373ef5141183ee43e6191b58 (diff)
target: remove useless casts
A reader should spend an extra moment whenever noticing a cast, because either something special is going on that deserves extra attention or, as is all too often the case, the code is wrong. These casts, afaics, have all been useless. They cast a foo* to a foo*, cast a void* to the assigned type, cast a foo* to void*, before assigning it to a void* variable, etc. In a few cases I also removed an additional &...[0], which is equally useless. Lastly I added three FIXMEs where, to the best of my judgement, the code appears to have a bug. It would be good if someone could check these. Signed-off-by: Joern Engel <joern@logfs.org> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/target/loopback')
-rw-r--r--drivers/target/loopback/tcm_loop.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/drivers/target/loopback/tcm_loop.c b/drivers/target/loopback/tcm_loop.c
index d427a290e184..572d27a6b7ae 100644
--- a/drivers/target/loopback/tcm_loop.c
+++ b/drivers/target/loopback/tcm_loop.c
@@ -559,8 +559,7 @@ static char *tcm_loop_get_fabric_name(void)
559 559
560static u8 tcm_loop_get_fabric_proto_ident(struct se_portal_group *se_tpg) 560static u8 tcm_loop_get_fabric_proto_ident(struct se_portal_group *se_tpg)
561{ 561{
562 struct tcm_loop_tpg *tl_tpg = 562 struct tcm_loop_tpg *tl_tpg = se_tpg->se_tpg_fabric_ptr;
563 (struct tcm_loop_tpg *)se_tpg->se_tpg_fabric_ptr;
564 struct tcm_loop_hba *tl_hba = tl_tpg->tl_hba; 563 struct tcm_loop_hba *tl_hba = tl_tpg->tl_hba;
565 /* 564 /*
566 * tl_proto_id is set at tcm_loop_configfs.c:tcm_loop_make_scsi_hba() 565 * tl_proto_id is set at tcm_loop_configfs.c:tcm_loop_make_scsi_hba()
@@ -587,8 +586,7 @@ static u8 tcm_loop_get_fabric_proto_ident(struct se_portal_group *se_tpg)
587 586
588static char *tcm_loop_get_endpoint_wwn(struct se_portal_group *se_tpg) 587static char *tcm_loop_get_endpoint_wwn(struct se_portal_group *se_tpg)
589{ 588{
590 struct tcm_loop_tpg *tl_tpg = 589 struct tcm_loop_tpg *tl_tpg = se_tpg->se_tpg_fabric_ptr;
591 (struct tcm_loop_tpg *)se_tpg->se_tpg_fabric_ptr;
592 /* 590 /*
593 * Return the passed NAA identifier for the SAS Target Port 591 * Return the passed NAA identifier for the SAS Target Port
594 */ 592 */
@@ -597,8 +595,7 @@ static char *tcm_loop_get_endpoint_wwn(struct se_portal_group *se_tpg)
597 595
598static u16 tcm_loop_get_tag(struct se_portal_group *se_tpg) 596static u16 tcm_loop_get_tag(struct se_portal_group *se_tpg)
599{ 597{
600 struct tcm_loop_tpg *tl_tpg = 598 struct tcm_loop_tpg *tl_tpg = se_tpg->se_tpg_fabric_ptr;
601 (struct tcm_loop_tpg *)se_tpg->se_tpg_fabric_ptr;
602 /* 599 /*
603 * This Tag is used when forming SCSI Name identifier in EVPD=1 0x83 600 * This Tag is used when forming SCSI Name identifier in EVPD=1 0x83
604 * to represent the SCSI Target Port. 601 * to represent the SCSI Target Port.
@@ -618,8 +615,7 @@ static u32 tcm_loop_get_pr_transport_id(
618 int *format_code, 615 int *format_code,
619 unsigned char *buf) 616 unsigned char *buf)
620{ 617{
621 struct tcm_loop_tpg *tl_tpg = 618 struct tcm_loop_tpg *tl_tpg = se_tpg->se_tpg_fabric_ptr;
622 (struct tcm_loop_tpg *)se_tpg->se_tpg_fabric_ptr;
623 struct tcm_loop_hba *tl_hba = tl_tpg->tl_hba; 619 struct tcm_loop_hba *tl_hba = tl_tpg->tl_hba;
624 620
625 switch (tl_hba->tl_proto_id) { 621 switch (tl_hba->tl_proto_id) {
@@ -648,8 +644,7 @@ static u32 tcm_loop_get_pr_transport_id_len(
648 struct t10_pr_registration *pr_reg, 644 struct t10_pr_registration *pr_reg,
649 int *format_code) 645 int *format_code)
650{ 646{
651 struct tcm_loop_tpg *tl_tpg = 647 struct tcm_loop_tpg *tl_tpg = se_tpg->se_tpg_fabric_ptr;
652 (struct tcm_loop_tpg *)se_tpg->se_tpg_fabric_ptr;
653 struct tcm_loop_hba *tl_hba = tl_tpg->tl_hba; 648 struct tcm_loop_hba *tl_hba = tl_tpg->tl_hba;
654 649
655 switch (tl_hba->tl_proto_id) { 650 switch (tl_hba->tl_proto_id) {
@@ -682,8 +677,7 @@ static char *tcm_loop_parse_pr_out_transport_id(
682 u32 *out_tid_len, 677 u32 *out_tid_len,
683 char **port_nexus_ptr) 678 char **port_nexus_ptr)
684{ 679{
685 struct tcm_loop_tpg *tl_tpg = 680 struct tcm_loop_tpg *tl_tpg = se_tpg->se_tpg_fabric_ptr;
686 (struct tcm_loop_tpg *)se_tpg->se_tpg_fabric_ptr;
687 struct tcm_loop_hba *tl_hba = tl_tpg->tl_hba; 681 struct tcm_loop_hba *tl_hba = tl_tpg->tl_hba;
688 682
689 switch (tl_hba->tl_proto_id) { 683 switch (tl_hba->tl_proto_id) {