From: Paolo Bonzini <pbonzini@redhat.com>
To: "Michael S. Tsirkin" <mst@redhat.com>, Don Slutz <Don@cloudswitch.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] hw: Add support for new LSI Logic devices.
Date: Wed, 12 Sep 2012 08:01:41 +0200 [thread overview]
Message-ID: <50502545.5040508@redhat.com> (raw)
In-Reply-To: <20120911235020.GC29044@redhat.com>
Il 12/09/2012 01:50, Michael S. Tsirkin ha scritto:
> +static void lsilogic_abort_command(LsilogicCmd *cmd)
> +{
> + if (cmd->req) {
> + scsi_req_cancel(cmd->req);
> + cmd->req = NULL;
> + }
> +}
This only needs to be cmd->req = NULL.
>
> + if (cmd) {
> + lsilogic_abort_command(cmd);
> + } else {
> + scsi_req_unref(req);
> + }
This should be
if (cmd && cmd->req) {
scsi_req_unref(req);
cmd->req = NULL;
}
>> + cmd->iov_size);
>> + }
>> + cmd->iov_size = len;
>> + }
>> + scsi_req_continue(cmd->req);
>> + }
>> + if (len > 0) {
>> + if (is_write) {
>> + trace_lsilogic_scsi_write_start(cmd->index, len);
>> + } else {
>> + trace_lsilogic_scsi_read_start(cmd->index, len);
>> + }
>> + } else {
>> + trace_lsilogic_scsi_nodata(cmd->index);
>> + }
I think the second if needs to go before scsi_req_continue, otherwise
the trace will be a bit confused.
The SCSI parts otherwise look good. I don't think there's much value in
keeping the coding standards for code that comes from elsewhere (I mean
mostly the struct definitions).
For the obvious bikeshedding, please call this lsisas1068.[ch].
Paolo
next prev parent reply other threads:[~2012-09-12 6:01 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-11 17:00 [Qemu-devel] [PATCH] hw: Add support for new LSI Logic devices Don Slutz
2012-09-11 23:50 ` Michael S. Tsirkin
2012-09-12 6:01 ` Paolo Bonzini [this message]
2012-09-12 12:36 ` Kevin Wolf
2012-09-12 13:58 ` Anthony Liguori
2012-09-13 6:24 ` Paolo Bonzini
2012-09-13 13:14 ` Anthony Liguori
2012-10-04 13:45 ` Hannes Reinecke
2012-09-13 12:43 ` Don Slutz
2012-09-12 6:58 ` Gerhard Wiesinger
2012-09-13 17:10 ` Don Slutz
2012-09-12 15:38 ` Avi Kivity
2012-09-13 12:46 ` Don Slutz
2012-09-13 13:54 ` Michael S. Tsirkin
2012-09-13 20:57 ` Anthony Liguori
2012-09-29 14:35 ` Don Slutz
2012-10-01 14:25 ` Paolo Bonzini
2012-11-08 19:03 ` Gerhard Wiesinger
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=50502545.5040508@redhat.com \
--to=pbonzini@redhat.com \
--cc=Don@cloudswitch.com \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.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).