From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52899) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WXUi1-0004kE-Er for qemu-devel@nongnu.org; Tue, 08 Apr 2014 08:01:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WXUhs-0002kz-Ei for qemu-devel@nongnu.org; Tue, 08 Apr 2014 08:00:57 -0400 Message-ID: <5343E4D4.6070305@gmail.com> Date: Tue, 08 Apr 2014 20:00:20 +0800 From: Chen Gang MIME-Version: 1.0 References: <53337BEB.90305@gmail.com> <87wqfgrp83.fsf@blackfin.pond.sub.org> <5333F6E2.9080202@gmail.com> <53382DDD.8050001@gmail.com> <87fvlylf02.fsf@blackfin.pond.sub.org> <53396545.805@gmail.com> <533969AB.4010505@gmail.com> <53396CE9.9090405@gmail.com> <533E7DD5.3090203@gmail.com> <5340F4FD.7040305@msgid.tls.msk.ru> <53414941.5040908@gmail.com> In-Reply-To: <53414941.5040908@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [PATCH trivial 0/3] vl: simplify code for main() and get_boot_device() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Michael Tokarev Cc: QEMU Trivial , Peter Maydell , Markus Armbruster , Anthony Liguori , QEMU Developers In "vl.c", at least, we can simplify the code below, so can let readers read professional C code (especially for new readers, which often start reading code at main function). - remove useless 'continue' in main(). - remove redundant local variable 'res' in get_boot_device(). - remove local variable 'args' in the middle of code block in main(). The following 3 patches are for the 3 'remove' above. And "vl.c" has a very long function main() which is about 17K lines. Next, it can be split into sub-functions (so can bypass another code style issue: multiple "{...}" styles within "swith(...)"). Signed-off-by: Chen Gang --- vl.c | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-)