linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dan Williams <dan.j.williams@intel.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: linux-scsi <linux-scsi@vger.kernel.org>,
	David Milburn <dmilburn@redhat.com>,
	Dave Jiang <dave.jiang@intel.com>,
	Ed Ciechanowski <ed.ciechanowski@intel.com>,
	Ed Nadolski <edmund.nadolski@intel.com>,
	Jacek Danecki <jacek.danecki@intel.com>,
	Jeff Skirvin <jeffrey.d.skirvin@intel.com>
Subject: Re: [PATCH, RFC] isci: remove scic_controller state handlers
Date: Wed, 13 Apr 2011 18:17:25 -0700	[thread overview]
Message-ID: <BANLkTi=aDVT-OLdmXzu2E4hB5Tek8AcTaA@mail.gmail.com> (raw)
In-Reply-To: <20110402121520.GB30913@infradead.org>

On Sat, Apr 2, 2011 at 5:15 AM, Christoph Hellwig <hch@infradead.org> 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@lst.de>
>
[..]
> -       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@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

      parent reply	other threads:[~2011-04-14  1:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-02 12:15 [PATCH, RFC] isci: remove scic_controller state handlers Christoph Hellwig
2011-04-08 17:47 ` Jiang, Dave
2011-04-14  1:17 ` Dan Williams [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='BANLkTi=aDVT-OLdmXzu2E4hB5Tek8AcTaA@mail.gmail.com' \
    --to=dan.j.williams@intel.com \
    --cc=dave.jiang@intel.com \
    --cc=dmilburn@redhat.com \
    --cc=ed.ciechanowski@intel.com \
    --cc=edmund.nadolski@intel.com \
    --cc=hch@infradead.org \
    --cc=jacek.danecki@intel.com \
    --cc=jeffrey.d.skirvin@intel.com \
    --cc=linux-scsi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).