[PATCH 3/5] firewire: fw-sbp2: use sdev->hostdata

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



to simplify a few pointer expressions.

Signed-off-by: Stefan Richter <stefanr@xxxxxxxxxxxxxxxxx>
---
 drivers/firewire/fw-sbp2.c |   17 +++++++----------
 1 file changed, 7 insertions(+), 10 deletions(-)

Index: linux/drivers/firewire/fw-sbp2.c
===================================================================
--- linux.orig/drivers/firewire/fw-sbp2.c
+++ linux/drivers/firewire/fw-sbp2.c
@@ -602,7 +602,7 @@ static void sbp2_login(struct work_struc
 
 	/* FIXME: Loop over luns here. */
 	lun = 0;
-	sdev = __scsi_add_device(host, 0, 0, lun, NULL);
+	sdev = __scsi_add_device(host, 0, 0, lun, sd);
 	if (IS_ERR(sdev)) {
 		sbp2_send_management_orb(unit, sd->node_id, sd->generation,
 					 SBP2_LOGOUT_REQUEST, sd->login_id,
@@ -897,8 +897,7 @@ complete_command_orb(struct sbp2_orb *ba
 
 static int sbp2_command_orb_map_scatterlist(struct sbp2_command_orb *orb)
 {
-	struct sbp2_device *sd =
-		(struct sbp2_device *)orb->cmd->device->host->hostdata;
+	struct sbp2_device *sd = orb->cmd->device->hostdata;
 	struct fw_unit *unit = sd->unit;
 	struct fw_device *device = fw_device(unit->device.parent);
 	struct scatterlist *sg;
@@ -983,8 +982,7 @@ static int sbp2_command_orb_map_scatterl
 
 static int sbp2_scsi_queuecommand(struct scsi_cmnd *cmd, scsi_done_fn_t done)
 {
-	struct sbp2_device *sd =
-		(struct sbp2_device *)cmd->device->host->hostdata;
+	struct sbp2_device *sd = cmd->device->hostdata;
 	struct fw_unit *unit = sd->unit;
 	struct fw_device *device = fw_device(unit->device.parent);
 	struct sbp2_command_orb *orb;
@@ -1065,7 +1063,7 @@ static int sbp2_scsi_queuecommand(struct
 
 static int sbp2_scsi_slave_alloc(struct scsi_device *sdev)
 {
-	struct sbp2_device *sd = (struct sbp2_device *)sdev->host->hostdata;
+	struct sbp2_device *sd = sdev->hostdata;
 
 	sdev->allow_restart = 1;
 
@@ -1076,7 +1074,7 @@ static int sbp2_scsi_slave_alloc(struct 
 
 static int sbp2_scsi_slave_configure(struct scsi_device *sdev)
 {
-	struct sbp2_device *sd = (struct sbp2_device *)sdev->host->hostdata;
+	struct sbp2_device *sd = sdev->hostdata;
 	struct fw_unit *unit = sd->unit;
 
 	sdev->use_10_for_rw = 1;
@@ -1101,8 +1099,7 @@ static int sbp2_scsi_slave_configure(str
  */
 static int sbp2_scsi_abort(struct scsi_cmnd *cmd)
 {
-	struct sbp2_device *sd =
-		(struct sbp2_device *)cmd->device->host->hostdata;
+	struct sbp2_device *sd = cmd->device->hostdata;
 	struct fw_unit *unit = sd->unit;
 
 	fw_notify("sbp2_scsi_abort\n");
@@ -1133,7 +1130,7 @@ sbp2_sysfs_ieee1394_id_show(struct devic
 
 	if (!sdev)
 		return 0;
-	sd = (struct sbp2_device *)sdev->host->hostdata;
+	sd = sdev->hostdata;
 	unit = sd->unit;
 	device = fw_device(unit->device.parent);
 

-- 
Stefan Richter
-=====-=-=== -==- =---=
http://arcgraph.de/sr/

-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux