On Sat, Apr 2, 2011 at 5:15 AM, Christoph Hellwig <hch@xxxxxxxxxxxxx> wrote: > Remove the state handler indirections for the scic_controller, and replace > them with procedural calls that check for the correct state first. > > Signed-off-by: Christoph Hellwig <hch@xxxxxx> > [..] > - scic_sds_controller_start_request_handler_t start_io; > + enum sci_status status; > > - state = scic->state_machine.current_state_id; > - start_io = scic_sds_controller_state_handler_table[state].start_io; > + if (scic->state_machine.current_state_id != > + SCI_BASE_CONTROLLER_STATE_READY) { > + dev_warn(scic_to_dev(scic), "invalid state to start I/O"); > + return SCI_FAILURE_INVALID_STATE; > + } > > - return start_io(scic, > - (struct sci_base_remote_device *) remote_device, > - request, io_tag); > + status = scic_sds_remote_device_start_io(scic, rdev, req); Nice, we casted to a base device only to pass it to a routine that took a device directly. Glad that's gone. Everything else looks ok. -- Dan -- 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