From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LC1x1-0005G7-3Q for qemu-devel@nongnu.org; Sun, 14 Dec 2008 20:08:47 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LC1wz-0005DH-Gy for qemu-devel@nongnu.org; Sun, 14 Dec 2008 20:08:46 -0500 Received: from [199.232.76.173] (port=51418 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LC1wz-0005D7-Br for qemu-devel@nongnu.org; Sun, 14 Dec 2008 20:08:45 -0500 Received: from relay01.mx.bawue.net ([193.7.176.67]:41173) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LC1wy-0003Eq-Vr for qemu-devel@nongnu.org; Sun, 14 Dec 2008 20:08:45 -0500 Date: Mon, 15 Dec 2008 02:08:42 +0100 From: Thiemo Seufer Subject: Re: [Qemu-devel] [PATCH] SH7750/51: add register BCR3, NCR4, PCR, RTCOR, RTCNT, RTCSR, SDMR2, SDMR3 and fix BCR2 support Message-ID: <20081215010842.GA12052@networkno.de> References: <1228477782-19842-1-git-send-email-plagnioj@jcrosoft.com> <4944EFFE.1050604@juno.dti.ne.jp> <20081214145145.GC18560@game.jcrosoft.org> <494527F5.3030109@juno.dti.ne.jp> <20081214163710.GB28340@game.jcrosoft.org> <20081214172431.GC7738@networkno.de> <4945A6D2.8020806@juno.dti.ne.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4945A6D2.8020806@juno.dti.ne.jp> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Shin-ichiro KAWASAKI Cc: Takashi Yoshii , Nobuhiro Iwamatsu , qemu-devel@nongnu.org Shin-ichiro KAWASAKI wrote: [snip] >>>>>> Compared to 'if' statement, 'switch-case' might be more easy to >>>>>> understand, like as follows. >>>>>> case SH7750_SDMR2 ... SH7750_SDMR2 + SDMR2_REGNB >>>>> ok elvenif it's a gcc ony extension >>>> Ah, gccism policy seems not clear in QEMU project. >>>> This extension is used in many hw/*.c, so I guessed it >>>> as a QEMU's usual implementation style. >>>> I hope comments on it from main developers. >>>> >>> Yes it will be nice >> >> I believe "no new gcc-isms" would be a good policy. > > Thank you. I'll follow it. Be aware that this was only my personal opinion, and not well-stated at that. From the recent discussion on IRC I believe we have now the rough consensus: "Use GCC extensions only when it improves the code significantly". > So, my suggestion about 'if' vs 'switch-case' is not appropriate. For the specific patch I believe the 'if' version is better. My opinion is largely formed by the 'SH7750_SDMR2 + SDMR2_REGNB' term: If this state doesn't deserve its own name, then it is probably not clear enough to be used in a case statement. Thiemo