From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:57368) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TfzZ0-0000SA-B6 for qemu-devel@nongnu.org; Tue, 04 Dec 2012 15:57:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TfzYz-0003k5-Bu for qemu-devel@nongnu.org; Tue, 04 Dec 2012 15:57:58 -0500 Received: from mail-bk0-f45.google.com ([209.85.214.45]:49134) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TfzYz-0003jr-3t for qemu-devel@nongnu.org; Tue, 04 Dec 2012 15:57:57 -0500 Received: by mail-bk0-f45.google.com with SMTP id jk13so1738847bkc.4 for ; Tue, 04 Dec 2012 12:57:55 -0800 (PST) Message-ID: <50BE63C7.9080402@gmail.com> Date: Tue, 04 Dec 2012 21:57:43 +0100 From: Antoine Mathys MIME-Version: 1.0 References: <50BB8C7A.7010304@gmail.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1/4] hw/ds1338.c: Fix handling of HOURS register. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: qemu-devel@nongnu.org, paul@codesourcery.com On 12/04/2012 06:42 PM, Peter Maydell wrote: > This looks good as far as the logic goes, but I think we could use > some symbolic constants for the 12-hour and PM bits rather than all > the literal 0x20 0x40 0x60. thanks -- PMM I refrained from using symbolic constants for three reasons: 1. You need to refer to the datasheet anyway to understand what is going on. 2. The code is short and it is easy to keep track of a few constants. 3. Symbolic names, which can be quite long, tend to make the code harder rather than easier to read It is largely a matter of preference though and I'm not opposed to the idea. I would appreciate naming suggestions though. I propose not to have symbolic constants for the registers and to use CH, OSF, MODE12, PM for the various bits, provided such short names are acceptable. I'd really hate something like REG_HOURS_MODE12.