Re: [PATCH, RFC] isci: remove scic_controller state handlers

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

 



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


[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