From: Dan Williams Date: Sat, 12 Feb 2011 19:50:15 +0000 (-0800) Subject: isci: kill a callback cast X-Git-Tag: firefly_0821_release~3680^2~5121^2~1^2~261 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=f7d36e1872c0d79ea9e31445c3b1b70602dbac4b;p=firefly-linux-kernel-4.4.55.git isci: kill a callback cast Callbacks are already type unsafe, obfuscating things further by casting the callback routine is less safe because now function argument number changes will not be caught by the compiler. Signed-off-by: Dan Williams --- diff --git a/drivers/scsi/isci/core/scic_sds_remote_device.c b/drivers/scsi/isci/core/scic_sds_remote_device.c index 5fc1baaa56d0..643247f46a7e 100644 --- a/drivers/scsi/isci/core/scic_sds_remote_device.c +++ b/drivers/scsi/isci/core/scic_sds_remote_device.c @@ -583,19 +583,20 @@ void scic_sds_remote_device_start_request( * serves as a callback when RNC gets resumed during a task management * sequence. none */ -void scic_sds_remote_device_continue_request( - struct scic_sds_remote_device *this_device) +void scic_sds_remote_device_continue_request(void *dev) { + struct scic_sds_remote_device *sci_dev = dev; + struct scic_sds_request *sci_req = sci_dev->working_request; + /* we need to check if this request is still valid to continue. */ - if (this_device->working_request != NULL) { - struct scic_sds_request *this_request = this_device->working_request; - struct scic_sds_controller *scic = this_request->owning_controller; + if (sci_req) { + struct scic_sds_controller *scic = sci_req->owning_controller; u32 state = scic->parent.state_machine.current_state_id; sci_base_controller_request_handler_t continue_io; continue_io = scic_sds_controller_state_handler_table[state].base.continue_io; - continue_io(&scic->parent, &this_request->target_device->parent, - &this_request->parent); + continue_io(&scic->parent, &sci_req->target_device->parent, + &sci_req->parent); } } diff --git a/drivers/scsi/isci/core/scic_sds_remote_device.h b/drivers/scsi/isci/core/scic_sds_remote_device.h index d91570f212c6..4841e4579643 100644 --- a/drivers/scsi/isci/core/scic_sds_remote_device.h +++ b/drivers/scsi/isci/core/scic_sds_remote_device.h @@ -509,8 +509,7 @@ void scic_sds_remote_device_start_request( struct scic_sds_request *the_request, enum sci_status status); -void scic_sds_remote_device_continue_request( - struct scic_sds_remote_device *this_device); +void scic_sds_remote_device_continue_request(void *sci_dev); enum sci_status scic_sds_remote_device_default_start_handler( struct sci_base_remote_device *this_device); diff --git a/drivers/scsi/isci/core/scic_sds_stp_remote_device.c b/drivers/scsi/isci/core/scic_sds_stp_remote_device.c index 0060804a2402..880e0e5932c0 100644 --- a/drivers/scsi/isci/core/scic_sds_stp_remote_device.c +++ b/drivers/scsi/isci/core/scic_sds_stp_remote_device.c @@ -188,7 +188,6 @@ static enum sci_status scic_sds_stp_remote_device_ready_substate_start_request_h scic_sds_remote_node_context_resume( this_device->rnc, - (scics_sds_remote_node_context_callback) scic_sds_remote_device_continue_request, this_device); }