From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:57426) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TBg1C-0002rx-Nc for qemu-devel@nongnu.org; Wed, 12 Sep 2012 02:01:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TBg1B-0004n0-M9 for qemu-devel@nongnu.org; Wed, 12 Sep 2012 02:01:46 -0400 Received: from mail-wg0-f53.google.com ([74.125.82.53]:44485) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TBg1B-0004mD-Fh for qemu-devel@nongnu.org; Wed, 12 Sep 2012 02:01:45 -0400 Received: by wgbfm10 with SMTP id fm10so834249wgb.10 for ; Tue, 11 Sep 2012 23:01:44 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <50502545.5040508@redhat.com> Date: Wed, 12 Sep 2012 08:01:41 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1347382813-5662-1-git-send-email-Don@CloudSwitch.com> <20120911235020.GC29044@redhat.com> In-Reply-To: <20120911235020.GC29044@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] hw: Add support for new LSI Logic devices. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" , Don Slutz Cc: qemu-devel@nongnu.org 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