Skip to content

Commit

Permalink
isci: kill a callback cast
Browse files Browse the repository at this point in the history
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 <dan.j.williams@intel.com>
  • Loading branch information
Dan Williams committed Jul 3, 2011
1 parent 27d42e3 commit f7d36e1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
15 changes: 8 additions & 7 deletions drivers/scsi/isci/core/scic_sds_remote_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down
3 changes: 1 addition & 2 deletions drivers/scsi/isci/core/scic_sds_remote_device.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 0 additions & 1 deletion drivers/scsi/isci/core/scic_sds_stp_remote_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit f7d36e1

Please sign in to comment.