From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LAtLW-00071s-JV for qemu-devel@nongnu.org; Thu, 11 Dec 2008 16:45:22 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LAtLT-00070q-Ho for qemu-devel@nongnu.org; Thu, 11 Dec 2008 16:45:21 -0500 Received: from [199.232.76.173] (port=58294 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LAtLT-00070j-7T for qemu-devel@nongnu.org; Thu, 11 Dec 2008 16:45:19 -0500 Received: from yw-out-1718.google.com ([74.125.46.154]:1602) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LAtLS-0004rq-NJ for qemu-devel@nongnu.org; Thu, 11 Dec 2008 16:45:18 -0500 Received: by yw-out-1718.google.com with SMTP id 6so532882ywa.82 for ; Thu, 11 Dec 2008 13:45:17 -0800 (PST) Message-ID: <494189E9.4040007@codemonkey.ws> Date: Thu, 11 Dec 2008 15:45:13 -0600 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 01/13] hw/ppc.c: LOG_IRQ macro References: <1228933464-7670-1-git-send-email-ehabkost@redhat.com> <1228933464-7670-2-git-send-email-ehabkost@redhat.com> In-Reply-To: <1228933464-7670-2-git-send-email-ehabkost@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Eduardo Habkost Eduardo Habkost wrote: > This macro will avoid some #ifdefs in the code and create a single point > where the logging call can be changed in the future. > > Signed-off-by: Eduardo Habkost > --- > hw/ppc.c | 10 ++++++++++ > 1 files changed, 10 insertions(+), 0 deletions(-) > > diff --git a/hw/ppc.c b/hw/ppc.c > index 60d6e86..cbd69e0 100644 > --- a/hw/ppc.c > +++ b/hw/ppc.c > @@ -31,6 +31,16 @@ > //#define PPC_DEBUG_IRQ > //#define PPC_DEBUG_TB > > +#ifdef PPC_DEBUG_IRQ > +# define LOG_IRQ(...) do { \ > + if (loglevel & CPU_LOG_INT) \ > + fprintf(logfile, __VA_ARGS__); \ > + } while (0) > +#else > +# define LOG_IRQ(...) do { } while (0) > +#endif > This style of macro is less ideal than: #define LOG_IRQ(fmt, ...) fprintf(logfile, fmt, ## __VA_ARGS__). Other than that, this series looks pretty sane. If you fix these macros, I'll apply the series. Regards, Anthony Liguori > + > + > static void cpu_ppc_tb_stop (CPUState *env); > static void cpu_ppc_tb_start (CPUState *env); > >