From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34331) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XS1zq-0004yc-Cy for qemu-devel@nongnu.org; Thu, 11 Sep 2014 06:53:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XS1zk-0004SC-9V for qemu-devel@nongnu.org; Thu, 11 Sep 2014 06:53:02 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40412) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XS1zk-0004S0-28 for qemu-devel@nongnu.org; Thu, 11 Sep 2014 06:52:56 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s8BAqtFl011408 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Thu, 11 Sep 2014 06:52:55 -0400 Message-ID: <54117F04.4060501@redhat.com> Date: Thu, 11 Sep 2014 12:52:52 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1410430599-27540-1-git-send-email-famz@redhat.com> <1410430599-27540-2-git-send-email-famz@redhat.com> In-Reply-To: <1410430599-27540-2-git-send-email-famz@redhat.com> Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1/2] scsi: Optimize scsi_req_alloc List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng , qemu-devel@nongnu.org Just a few nits... Il 11/09/2014 12:16, Fam Zheng ha scritto: > + uint32_t sense_len; sense_len is initialized to zero, might as well do that via memset. > + uint8_t sense[SCSI_SENSE_BUF_SIZE]; > + bool enqueued; > + bool io_canceled; > + bool retry; > + bool dma_started; > + void *hba_private; hba_private is always initialized by scsi_req_alloc. > size_t resid; > SCSICommand cmd; resid and cmd are initialized by scsi_req_new (all calls to scsi_req_alloc happen in scsi_req_new, possibly via scsi_device_alloc_req). > BlockDriverAIOCB *aiocb; > QEMUSGList *sg; > - bool dma_started; > - uint8_t sense[SCSI_SENSE_BUF_SIZE]; > - uint32_t sense_len; > - bool enqueued; > - bool io_canceled; > - bool retry; > - void *hba_private; > QTAILQ_ENTRY(SCSIRequest) next; Not sure if next needs to be initialized for the QTAILQ functions to work, but it's definitely safer this way. Thanks, Paolo