From patchwork Sat Apr 1 13:34:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Danil Antonov X-Patchwork-Id: 745966 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3vwK9T4P7Qz9rxm for ; Sun, 2 Apr 2017 00:34:53 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="qNZppaFR"; dkim-atps=neutral Received: from localhost ([::1]:51349 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cuJB5-0002wf-2s for incoming@patchwork.ozlabs.org; Sat, 01 Apr 2017 09:34:51 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47448) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cuJAa-0002vH-Fh for qemu-devel@nongnu.org; Sat, 01 Apr 2017 09:34:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cuJAZ-00074L-FL for qemu-devel@nongnu.org; Sat, 01 Apr 2017 09:34:20 -0400 Received: from mail-oi0-x243.google.com ([2607:f8b0:4003:c06::243]:36143) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cuJAZ-000745-AL for qemu-devel@nongnu.org; Sat, 01 Apr 2017 09:34:19 -0400 Received: by mail-oi0-x243.google.com with SMTP id b187so13162216oif.3 for ; Sat, 01 Apr 2017 06:34:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=+eK4qS9xwGgcTXevb+r4tlC/FJaItrwo2PyNDecRtaw=; b=qNZppaFRpkWgLZjgPSVP2oImHJj/HidoIG3uoLi8wOkMRFAPQ2FycOaqYiocvWOWdw 6UOpxVvLl3Ar8r77SCSLJMzLZe1sP5Nsdz97CHIBdTS4mTUOljrXRR3YmcVX4h4cdnt2 7kr4Qy5ak6bX/tEi4PCO2IqXJJTktth8YFQ6c/5mzdPFKoBcx7SkOeGFitUBqLkyy7fg q3RrRbEVH/tdoYcbQbj8xAbCEDwEs/i9U6zS1Z34phPY4KH2WUl1+XXT7RB3WXekbY0o IeiwsxFKg1aMIUUNT5xG0w0EugoHHUG5DPj3+Truf+Jkr5Ewq41RtZPz8/V5DLwNNKC3 rtxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=+eK4qS9xwGgcTXevb+r4tlC/FJaItrwo2PyNDecRtaw=; b=h3v1uIRXU9o19gH1kilwb4zeSPAjdrAu+Rgoz3mAi7wFN+c6Bqw7vo8R80sf0IZ9A4 ApIJBUBFrylxZSe7oYiWMlyzednsahfqnW1hy0ixOejHO1xVVZ8yF8t21isIRlpktAm5 s2/TKyuCPz3iA683PBLlXYr165wh4HoywagQuabVU1wEulPaeMOBzipV5K8PB/evdaEJ 1iFiYWewynSqspKbSXOfA6gLAo0wgYukH9Za3abfWqzuIJSUgNQmLF+ph8aswwBwgOQR spo6W+V8cBGiI1XTtmi9Q11zTPtF2RNxwTMFwYsLnC4GO6H76rFLoTsbogZdVFi6myNe s2KA== X-Gm-Message-State: AFeK/H1Z/XQ3mfxCi6dYRNK6ALmLpL+aYALCTFt8fMzXOSGmVMQGX5qHpv5Ox5nepOZR7evrScJhNTHfUAFlWw== X-Received: by 10.202.207.19 with SMTP id f19mr4738215oig.115.1491053658687; Sat, 01 Apr 2017 06:34:18 -0700 (PDT) MIME-Version: 1.0 Received: by 10.157.32.234 with HTTP; Sat, 1 Apr 2017 06:34:18 -0700 (PDT) From: Danil Antonov Date: Sat, 1 Apr 2017 16:34:18 +0300 Message-ID: To: qemu-devel@nongnu.org, sstabellini@kernel.org, anthony.perard@citrix.com X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:4003:c06::243 X-Content-Filtered-By: Mailman/MimeDel 2.1.21 Subject: [Qemu-devel] [PATCH 04/43] xen-hvm: made printf always compile in debug output X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From 05d558842b0a10ee3f0606eb54068b6ba03906a3 Mon Sep 17 00:00:00 2001 From: Danil Antonov Date: Wed, 29 Mar 2017 02:13:13 +0300 Subject: [PATCH 04/43] xen-hvm: made printf always compile in debug output Wrapped printf calls inside debug macros (DPRINTF) in `if` statement. This will ensure that printf function will always compile even if debug output is turned off and, in turn, will prevent bitrot of the format strings. Signed-off-by: Danil Antonov --- xen-hvm.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/xen-hvm.c b/xen-hvm.c index 5043beb..abf0f72 100644 --- a/xen-hvm.c +++ b/xen-hvm.c @@ -29,15 +29,15 @@ #include #include -//#define DEBUG_XEN_HVM - -#ifdef DEBUG_XEN_HVM -#define DPRINTF(fmt, ...) \ - do { fprintf(stderr, "xen: " fmt, ## __VA_ARGS__); } while (0) -#else -#define DPRINTF(fmt, ...) \ - do { } while (0) -#endif +#ifndef DEBUG_XEN_HVM +#define DEBUG_XEN_HVM 0 +#endif + +#define DPRINTF(fmt, ...) do { \ + if (DEBUG_XEN_HVM) { \ + fprintf(stderr, "xen: " fmt, ## __VA_ARGS__); \ + } \ +} while (0); static MemoryRegion ram_memory, ram_640k, ram_lo, ram_hi; static MemoryRegion *framebuffer;