Received: from eggs.gnu.org ([2001:4830:134:3::10]:39153) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vr13P-0008Un-Ti for qemu-devel@nongnu.org; Thu, 12 Dec 2013 02:51:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vr13G-0001c4-Vj for qemu-devel@nongnu.org; Thu, 12 Dec 2013 02:51:27 -0500 Received: from e06smtp10.uk.ibm.com ([195.75.94.106]:38259) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vr13G-0001ay-M7 for qemu-devel@nongnu.org; Thu, 12 Dec 2013 02:51:18 -0500 Received: from /spool/local by e06smtp10.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 12 Dec 2013 07:51:14 -0000 Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by d06dlp01.portsmouth.uk.ibm.com (Postfix) with ESMTP id B9D9417D8058 for ; Thu, 12 Dec 2013 07:51:08 +0000 (GMT) Received: from d06av04.portsmouth.uk.ibm.com (d06av04.portsmouth.uk.ibm.com [9.149.37.216]) by b06cxnps4075.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id rBC7p0U166977826 for ; Thu, 12 Dec 2013 07:51:00 GMT Received: from d06av04.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av04.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id rBC7pC8q005137 for ; Thu, 12 Dec 2013 00:51:12 -0700 Date: Thu, 12 Dec 2013 08:51:10 +0100 From: Thomas Huth Message-ID: <20131212085110.55ec7b7c@oc7435384737.ibm.com> In-Reply-To: <52A9262D.7070406@linux.vnet.ibm.com> References: <1386796109-15264-1-git-send-email-kwolf@redhat.com> <1386796109-15264-2-git-send-email-kwolf@redhat.com> <52A92570.6030303@linux.vnet.ibm.com> <52A9262D.7070406@linux.vnet.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 01/22] block: Move initialisation of BlockLimits to bdrv_refresh_limits() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Wenchao Xia Cc: Kevin Wolf , pbonzini@redhat.com, pl@kamp.de, qemu-devel@nongnu.org, stefanha@redhat.com On Thu, 12 Dec 2013 10:57:49 +0800 Wenchao Xia wrote: > > >> +static int bdrv_refresh_limits(BlockDriverState *bs) > >> +{ > >> + BlockDriver *drv = bs->drv; > >> + > >> + memset(&bs->bl, 0, sizeof(bs->bl)); > >> + > >> + if (!drv) { > >> + return 0; > >> + } else if (drv->bdrv_refresh_limits) { > >> + return drv->bdrv_refresh_limits(bs); > >> + } > >> + > >> + return 0; > > It seems this line can be removed. > > > I missed the "else if", then the patch is OK. But it could also be written in a shorter way: if (drv && drv->bdrv_refresh_limits) { return drv->bdrv_refresh_limits(bs); } return 0; Regards, Thomas