[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] hw: Add support for new LSI Logic devices.
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH] hw: Add support for new LSI Logic devices. |
Date: |
Wed, 12 Sep 2012 08:01:41 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120828 Thunderbird/15.0 |
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
Re: [Qemu-devel] [PATCH] hw: Add support for new LSI Logic devices., Gerhard Wiesinger, 2012/09/12
Re: [Qemu-devel] [PATCH] hw: Add support for new LSI Logic devices., Avi Kivity, 2012/09/12
Re: [Qemu-devel] [PATCH] hw: Add support for new LSI Logic devices., Michael S. Tsirkin, 2012/09/13