aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/target/target_core_stat.c
diff options
context:
space:
mode:
authorJörn Engel <joern@logfs.org>2012-03-15 15:06:58 -0400
committerNicholas Bellinger <nab@linux-iscsi.org>2012-03-15 22:16:09 -0400
commit281689051a628e5341ce1efcfafde9d60f2f6fbb (patch)
tree15809410fe5d1c8540622f5bd7c726517b22ddd3 /drivers/target/target_core_stat.c
parentf2083241f23722207676025abbb45a301d412e69 (diff)
target: remove obvious warnings
Get rid of a bunch of write-only variables. In a number of cases I suspect actual bugs to be present, so I left all of those for a second look. (nab: fix lio-core patch fuzz) Signed-off-by: Joern Engel <joern@logfs.org> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/target/target_core_stat.c')
-rw-r--r--drivers/target/target_core_stat.c12
1 files changed, 0 insertions, 12 deletions
diff --git a/drivers/target/target_core_stat.c b/drivers/target/target_core_stat.c
index 7ce1bfa5c542..3d44beb0cf1f 100644
--- a/drivers/target/target_core_stat.c
+++ b/drivers/target/target_core_stat.c
@@ -954,7 +954,6 @@ static ssize_t target_stat_scsi_tgt_port_show_attr_in_cmds(
954{ 954{
955 struct se_lun *lun = container_of(pgrps, struct se_lun, port_stat_grps); 955 struct se_lun *lun = container_of(pgrps, struct se_lun, port_stat_grps);
956 struct se_port *sep; 956 struct se_port *sep;
957 struct se_portal_group *tpg;
958 ssize_t ret; 957 ssize_t ret;
959 958
960 spin_lock(&lun->lun_sep_lock); 959 spin_lock(&lun->lun_sep_lock);
@@ -963,7 +962,6 @@ static ssize_t target_stat_scsi_tgt_port_show_attr_in_cmds(
963 spin_unlock(&lun->lun_sep_lock); 962 spin_unlock(&lun->lun_sep_lock);
964 return -ENODEV; 963 return -ENODEV;
965 } 964 }
966 tpg = sep->sep_tpg;
967 965
968 ret = snprintf(page, PAGE_SIZE, "%llu\n", sep->sep_stats.cmd_pdus); 966 ret = snprintf(page, PAGE_SIZE, "%llu\n", sep->sep_stats.cmd_pdus);
969 spin_unlock(&lun->lun_sep_lock); 967 spin_unlock(&lun->lun_sep_lock);
@@ -976,7 +974,6 @@ static ssize_t target_stat_scsi_tgt_port_show_attr_write_mbytes(
976{ 974{
977 struct se_lun *lun = container_of(pgrps, struct se_lun, port_stat_grps); 975 struct se_lun *lun = container_of(pgrps, struct se_lun, port_stat_grps);
978 struct se_port *sep; 976 struct se_port *sep;
979 struct se_portal_group *tpg;
980 ssize_t ret; 977 ssize_t ret;
981 978
982 spin_lock(&lun->lun_sep_lock); 979 spin_lock(&lun->lun_sep_lock);
@@ -985,7 +982,6 @@ static ssize_t target_stat_scsi_tgt_port_show_attr_write_mbytes(
985 spin_unlock(&lun->lun_sep_lock); 982 spin_unlock(&lun->lun_sep_lock);
986 return -ENODEV; 983 return -ENODEV;
987 } 984 }
988 tpg = sep->sep_tpg;
989 985
990 ret = snprintf(page, PAGE_SIZE, "%u\n", 986 ret = snprintf(page, PAGE_SIZE, "%u\n",
991 (u32)(sep->sep_stats.rx_data_octets >> 20)); 987 (u32)(sep->sep_stats.rx_data_octets >> 20));
@@ -999,7 +995,6 @@ static ssize_t target_stat_scsi_tgt_port_show_attr_read_mbytes(
999{ 995{
1000 struct se_lun *lun = container_of(pgrps, struct se_lun, port_stat_grps); 996 struct se_lun *lun = container_of(pgrps, struct se_lun, port_stat_grps);
1001 struct se_port *sep; 997 struct se_port *sep;
1002 struct se_portal_group *tpg;
1003 ssize_t ret; 998 ssize_t ret;
1004 999
1005 spin_lock(&lun->lun_sep_lock); 1000 spin_lock(&lun->lun_sep_lock);
@@ -1008,7 +1003,6 @@ static ssize_t target_stat_scsi_tgt_port_show_attr_read_mbytes(
1008 spin_unlock(&lun->lun_sep_lock); 1003 spin_unlock(&lun->lun_sep_lock);
1009 return -ENODEV; 1004 return -ENODEV;
1010 } 1005 }
1011 tpg = sep->sep_tpg;
1012 1006
1013 ret = snprintf(page, PAGE_SIZE, "%u\n", 1007 ret = snprintf(page, PAGE_SIZE, "%u\n",
1014 (u32)(sep->sep_stats.tx_data_octets >> 20)); 1008 (u32)(sep->sep_stats.tx_data_octets >> 20));
@@ -1022,7 +1016,6 @@ static ssize_t target_stat_scsi_tgt_port_show_attr_hs_in_cmds(
1022{ 1016{
1023 struct se_lun *lun = container_of(pgrps, struct se_lun, port_stat_grps); 1017 struct se_lun *lun = container_of(pgrps, struct se_lun, port_stat_grps);
1024 struct se_port *sep; 1018 struct se_port *sep;
1025 struct se_portal_group *tpg;
1026 ssize_t ret; 1019 ssize_t ret;
1027 1020
1028 spin_lock(&lun->lun_sep_lock); 1021 spin_lock(&lun->lun_sep_lock);
@@ -1031,7 +1024,6 @@ static ssize_t target_stat_scsi_tgt_port_show_attr_hs_in_cmds(
1031 spin_unlock(&lun->lun_sep_lock); 1024 spin_unlock(&lun->lun_sep_lock);
1032 return -ENODEV; 1025 return -ENODEV;
1033 } 1026 }
1034 tpg = sep->sep_tpg;
1035 1027
1036 /* FIXME: scsiTgtPortHsInCommands */ 1028 /* FIXME: scsiTgtPortHsInCommands */
1037 ret = snprintf(page, PAGE_SIZE, "%u\n", 0); 1029 ret = snprintf(page, PAGE_SIZE, "%u\n", 0);
@@ -1275,7 +1267,6 @@ static ssize_t target_stat_scsi_auth_intr_show_attr_dev(
1275 struct se_node_acl *nacl = lacl->se_lun_nacl; 1267 struct se_node_acl *nacl = lacl->se_lun_nacl;
1276 struct se_dev_entry *deve; 1268 struct se_dev_entry *deve;
1277 struct se_lun *lun; 1269 struct se_lun *lun;
1278 struct se_portal_group *tpg;
1279 ssize_t ret; 1270 ssize_t ret;
1280 1271
1281 spin_lock_irq(&nacl->device_list_lock); 1272 spin_lock_irq(&nacl->device_list_lock);
@@ -1284,7 +1275,6 @@ static ssize_t target_stat_scsi_auth_intr_show_attr_dev(
1284 spin_unlock_irq(&nacl->device_list_lock); 1275 spin_unlock_irq(&nacl->device_list_lock);
1285 return -ENODEV; 1276 return -ENODEV;
1286 } 1277 }
1287 tpg = nacl->se_tpg;
1288 lun = deve->se_lun; 1278 lun = deve->se_lun;
1289 /* scsiDeviceIndex */ 1279 /* scsiDeviceIndex */
1290 ret = snprintf(page, PAGE_SIZE, "%u\n", lun->lun_se_dev->dev_index); 1280 ret = snprintf(page, PAGE_SIZE, "%u\n", lun->lun_se_dev->dev_index);
@@ -1643,7 +1633,6 @@ static ssize_t target_stat_scsi_att_intr_port_show_attr_dev(
1643 struct se_node_acl *nacl = lacl->se_lun_nacl; 1633 struct se_node_acl *nacl = lacl->se_lun_nacl;
1644 struct se_dev_entry *deve; 1634 struct se_dev_entry *deve;
1645 struct se_lun *lun; 1635 struct se_lun *lun;
1646 struct se_portal_group *tpg;
1647 ssize_t ret; 1636 ssize_t ret;
1648 1637
1649 spin_lock_irq(&nacl->device_list_lock); 1638 spin_lock_irq(&nacl->device_list_lock);
@@ -1652,7 +1641,6 @@ static ssize_t target_stat_scsi_att_intr_port_show_attr_dev(
1652 spin_unlock_irq(&nacl->device_list_lock); 1641 spin_unlock_irq(&nacl->device_list_lock);
1653 return -ENODEV; 1642 return -ENODEV;
1654 } 1643 }
1655 tpg = nacl->se_tpg;
1656 lun = deve->se_lun; 1644 lun = deve->se_lun;
1657 /* scsiDeviceIndex */ 1645 /* scsiDeviceIndex */
1658 ret = snprintf(page, PAGE_SIZE, "%u\n", lun->lun_se_dev->dev_index); 1646 ret = snprintf(page, PAGE_SIZE, "%u\n", lun->lun_se_dev->dev_index);