Skip to contentSkip to conversation

iscsi: kill redundant casts

PATCH In review Nick Black 2 participants 2 messages Jun 9, 2014 – Jun 10, 2014 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

Nick Black

author
#0 lore raw

PATCH 1/1 iscsi: kill redundant casts

Remove two redundant casts from char * to char *.

---
 drivers/scsi/scsi_transport_iscsi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/scsi_transport_iscsi.c +2 -2
index 0102a2d..38a1de3 100644
@@ -3059,7 +3059,7 @@ iscsi_get_chap(struct iscsi_transport *transport, struct nlmsghdr *nlh)
 		evchap->u.get_chap.host_no = ev->u.get_chap.host_no;
 		evchap->u.get_chap.chap_tbl_idx = ev->u.get_chap.chap_tbl_idx;
 		evchap->u.get_chap.num_entries = ev->u.get_chap.num_entries;
-		buf = (char *) ((char *)evchap + sizeof(*evchap));
+		buf = (char *)evchap + sizeof(*evchap);
 		memset(buf, 0, chap_buf_size);
 
 		err = transport->get_chap(shost, ev->u.get_chap.chap_tbl_idx,
@@ -3463,7 +3463,7 @@ iscsi_get_host_stats(struct iscsi_transport *transport, struct nlmsghdr *nlh)
 		evhost_stats->type = nlh->nlmsg_type;
 		evhost_stats->u.get_host_stats.host_no =
 					ev->u.get_host_stats.host_no;
-		buf = (char *)((char *)evhost_stats + sizeof(*evhost_stats));
+		buf = (char *)evhost_stats + sizeof(*evhost_stats);
 		memset(buf, 0, host_stats_size);
 
 		err = transport->get_host_stats(shost, buf, host_stats_size);
Signature · 1 line
2.0.0.526.g5318336

A message that is not in the archive (sent off-list or not yet received): 1402343822-27701-1-git-send-email-nlb-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org

Acked-by
#2 lore raw

Switching linux-kernel for linux-scsi mailing list.

Quoted 22 lines · Nick Black' via open-iscsi

Remove two redundant casts from char * to char *.

---
  drivers/scsi/scsi_transport_iscsi.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/scsi_transport_iscsi.c +1 -1
index 0102a2d..38a1de3 100644
@@ -3059,7 +3059,7 @@ iscsi_get_chap(struct iscsi_transport *transport, struct nlmsghdr *nlh)
  		evchap->u.get_chap.host_no = ev->u.get_chap.host_no;
  		evchap->u.get_chap.chap_tbl_idx = ev->u.get_chap.chap_tbl_idx;
  		evchap->u.get_chap.num_entries = ev->u.get_chap.num_entries;
-		buf = (char *) ((char *)evchap + sizeof(*evchap));
+		buf = (char *)evchap + sizeof(*evchap);
  		memset(buf, 0, chap_buf_size);
 
  		err = transport->get_chap(shost, ev->u.get_chap.chap_tbl_idx,

drivers/scsi/scsi_transport_iscsi.c iscsi_get_host_stats(struct iscsi_transport *transport, struct nlmsghdr *nlh) · line 3469

Quoted 8 lines
drivers/scsi/scsi_transport_iscsi.c +1 -1
@@ -3463,7 +3463,7 @@ iscsi_get_host_stats(struct iscsi_transport *transport, struct nlmsghdr *nlh)
  		evhost_stats->type = nlh->nlmsg_type;
  		evhost_stats->u.get_host_stats.host_no =
  					ev->u.get_host_stats.host_no;
-		buf = (char *)((char *)evhost_stats + sizeof(*evhost_stats));
+		buf = (char *)evhost_stats + sizeof(*evhost_stats);
  		memset(buf, 0, host_stats_size);
 
  		err = transport->get_host_stats(shost, buf, host_stats_size);

Looks ok to me.

Signature · 5 lines
You received this message because you are subscribed to the Google Groups "open-iscsi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to open-iscsi+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/[email protected]
To post to this group, send email to open-iscsi-/JYPxA39Uh5TLH3MbocFF+G/[email protected]
Visit this group at http://groups.google.com/group/open-iscsi.
For more options, visit https://groups.google.com/d/optout.