From patchwork Thu Mar 27 01:16:27 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen Gang X-Patchwork-Id: 334165 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id C6A0514008D for ; Thu, 27 Mar 2014 12:17:15 +1100 (EST) Received: from localhost ([::1]:51063 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WSywS-0000gJ-E0 for incoming@patchwork.ozlabs.org; Wed, 26 Mar 2014 21:17:12 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38918) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WSyw4-0000Tz-L8 for qemu-devel@nongnu.org; Wed, 26 Mar 2014 21:16:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WSyvq-0003Ps-LZ for qemu-devel@nongnu.org; Wed, 26 Mar 2014 21:16:48 -0400 Received: from mail-pd0-x232.google.com ([2607:f8b0:400e:c02::232]:40415) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WSyvq-0003PE-F9 for qemu-devel@nongnu.org; Wed, 26 Mar 2014 21:16:34 -0400 Received: by mail-pd0-f178.google.com with SMTP id x10so2618233pdj.23 for ; Wed, 26 Mar 2014 18:16:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; bh=kiqjuv1f9y3y+8koiDtQMbsAFKVEd+N4KVqZC+G1/Kw=; b=RbU/D4j0IBRx8W4L9XCEhRyHuGLcp9DSRTkNnr+ilNkPkCVXaz8BeUKNAvSGgKYHUK GuMO+RamUHePnrHrlW9AY/2R/vNMAxYmLDN+Rtv1nKeDL4GDSduGTGleRhY+R0ANc4qG WIkcgwuWR6x/uMFOmaQSuUswno/ibf2EXFym2zpxW+5DYaW8cJZ7VBhCRtc0o6s8wXdP JmVBZ6+wEBTVHs0lNQJ9d+hmBjEK6L42S+A0vgfjdDvPVXgHabEIcMmYUUC0UqoAkgpi jH4k/LjPGHqSFZiLM0lGyUooWxZGb5FIB952ZXadX21OegpY7lEcbL0KzzsIKOMmYFHI O3Og== X-Received: by 10.66.102.66 with SMTP id fm2mr8216834pab.51.1395882993038; Wed, 26 Mar 2014 18:16:33 -0700 (PDT) Received: from [192.168.1.121] ([124.126.231.208]) by mx.google.com with ESMTPSA id sh5sm1138792pbc.21.2014.03.26.18.16.30 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 26 Mar 2014 18:16:32 -0700 (PDT) Message-ID: <53337BEB.90305@gmail.com> Date: Thu, 27 Mar 2014 09:16:27 +0800 From: Chen Gang User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: aliguori@amazon.com, QEMU Developers X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:400e:c02::232 Subject: [Qemu-devel] [PATCH] vl.c: use 'break' instead of 'continue' in configure_accelerator() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org At present, each 'opt_name' of 'accel_list' is uniq with each other, so 'buf' can only match one 'opt_name'. When drop into the matching code block, can 'break' outside related 'for' looping after finish processing it (just like the other 'break' within the matching block). After print "... not support for this target", it can avoid to print "... accelerator does not exist". Signed-off-by: Chen Gang --- vl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vl.c b/vl.c index 842e897..b4f98fa 100644 --- a/vl.c +++ b/vl.c @@ -2709,7 +2709,7 @@ static int configure_accelerator(QEMUMachine *machine) if (!accel_list[i].available()) { printf("%s not supported for this target\n", accel_list[i].name); - continue; + break; } *(accel_list[i].allowed) = true; ret = accel_list[i].init(machine);