aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/target/target_core_fabric_lib.c
diff options
context:
space:
mode:
authorJörn Engel <joern@logfs.org>2011-11-24 02:05:51 +0100
committerNicholas Bellinger <nab@linux-iscsi.org>2011-12-14 11:28:07 +0000
commit8359cf43b9dccddeebb0d247146719a14ce6371a (patch)
tree25421cb0e06d878709a826edf8d724ca102ab441 /drivers/target/target_core_fabric_lib.c
parenttarget: simplify target_check_cdb_and_preempt (diff)
downloadlinux-dev-8359cf43b9dccddeebb0d247146719a14ce6371a.tar.xz
linux-dev-8359cf43b9dccddeebb0d247146719a14ce6371a.zip
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/target_core_fabric_lib.c')
-rw-r--r--drivers/target/target_core_fabric_lib.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/target/target_core_fabric_lib.c b/drivers/target/target_core_fabric_lib.c
index 32d7feb405ec..283a36e464e6 100644
--- a/drivers/target/target_core_fabric_lib.c
+++ b/drivers/target/target_core_fabric_lib.c
@@ -399,7 +399,7 @@ char *iscsi_parse_pr_out_transport_id(
add_len = ((buf[2] >> 8) & 0xff);
add_len |= (buf[3] & 0xff);
- tid_len = strlen((char *)&buf[4]);
+ tid_len = strlen(&buf[4]);
tid_len += 4; /* Add four bytes for iSCSI Transport ID header */
tid_len += 1; /* Add one byte for NULL terminator */
padding = ((-tid_len) & 3);
@@ -420,11 +420,11 @@ char *iscsi_parse_pr_out_transport_id(
* format.
*/
if (format_code == 0x40) {
- p = strstr((char *)&buf[4], ",i,0x");
+ p = strstr(&buf[4], ",i,0x");
if (!p) {
pr_err("Unable to locate \",i,0x\" seperator"
" for Initiator port identifier: %s\n",
- (char *)&buf[4]);
+ &buf[4]);
return NULL;
}
*p = '\0'; /* Terminate iSCSI Name */