From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:36250) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RvuB8-0002bE-4P for qemu-devel@nongnu.org; Fri, 10 Feb 2012 12:22:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RvuB0-00066Z-Ua for qemu-devel@nongnu.org; Fri, 10 Feb 2012 12:22:34 -0500 Received: from mail-pw0-f45.google.com ([209.85.160.45]:48014) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RvuB0-00066E-PG for qemu-devel@nongnu.org; Fri, 10 Feb 2012 12:22:26 -0500 Received: by pbbro12 with SMTP id ro12so2943851pbb.4 for ; Fri, 10 Feb 2012 09:22:25 -0800 (PST) Message-ID: <4F35524C.5070303@codemonkey.ws> Date: Fri, 10 Feb 2012 11:22:20 -0600 From: Anthony Liguori MIME-Version: 1.0 References: <4F351B73.9020001@codemonkey.ws> <20120210170903.GA475@amit.redhat.com> In-Reply-To: <20120210170903.GA475@amit.redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1/1] char: Add a QemuChrHandlers struct to initialise chardev handlers List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Amit Shah Cc: qemu list On 02/10/2012 11:09 AM, Amit Shah wrote: > On (Fri) 10 Feb 2012 [07:28:19], Anthony Liguori wrote: >> On 02/10/2012 07:19 AM, Amit Shah wrote: >>> Instead of passing each handler in the qemu_add_handlers() function, >>> create a struct of handlers that can be passed to the function instead. >>> >>> Signed-off-by: Amit Shah >> >> Why? > > It's a good cleanup. > >> It's not a win in terms of code size. If you plan on introducing >> additional handlers, perhaps you should include this in that series >> where it's more appropriately justified. >> >> As a change on it's own, it doesn't seem to make a lot of sense. > > Makes the code much easier to look at. Can't really compare on code > size, since there's zero change in the resulting binary, but the code > just becomes more readable and manageable. It's not more readable IMHO. You've taken function call arguments from the place they naturally belong (in the function call) and placed them somewhere else. More importantly, this isn't a pattern we use in QEMU anywhere. Regards, Anthony Liguori > > Amit