From patchwork Fri Mar 8 19:55:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jason Gunthorpe X-Patchwork-Id: 10845371 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B5D79922 for ; Fri, 8 Mar 2019 19:55:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A21DD2FE1E for ; Fri, 8 Mar 2019 19:55:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 96AAA2FF7A; Fri, 8 Mar 2019 19:55:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4BF612FE1E for ; Fri, 8 Mar 2019 19:55:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726718AbfCHTza (ORCPT ); Fri, 8 Mar 2019 14:55:30 -0500 Received: from mail-qt1-f196.google.com ([209.85.160.196]:33274 "EHLO mail-qt1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726789AbfCHTz3 (ORCPT ); Fri, 8 Mar 2019 14:55:29 -0500 Received: by mail-qt1-f196.google.com with SMTP id z39so22606617qtz.0 for ; Fri, 08 Mar 2019 11:55:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=qlr+EPvZGPDEANerZtrXPEcqwel7UuAg197SfTiT9To=; b=BOwoCBv8Z1WE05HMmHv7I1If2VooJW4HZ+7n1vrSb6bD/KsFFhvfNPfqD1AMsT4Lub Ed7bV7K9MIQl2g730qcNzCyTckMCLkqUteTG+tZpOFcHvDKXl38gCPYURBd9UaLNJPrt kmvAZwzJVWMp3JeAUr+iIKBDCD+CybhveYa9ZvpIDeSMLs74j1PL9MfPf6ojmDfCRQVi 0XIsa8obcUc+TKSn6j1uJvs2IYydik6aJENr86Xar2Si0BQidqtb0jkCJRBlqjyMw3s4 eyDLxwuWoXYkUhmtb81lNYubQQaQMBzPUkcuIs9UZcSSfs5fBShRsoyVwSsrOOxkLzlR V1rw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=qlr+EPvZGPDEANerZtrXPEcqwel7UuAg197SfTiT9To=; b=OdgAY9XLRKuUGIVM9Jc3bBZDWpRer3cTqP9ONwx2vRiAKnASyiiHa8m8d3Uu3l+u5u 0PCKvKF8dVqWNtVEhm26KKBEhqfQ9DDb9Q/+gRBOhl+xJd7FpiBUjxJQH3Of34Ty6uqT Nbc+8voP7pd4fJEVv847Dd189vWsvfgPL+Y22nDfpLl+pKAiizoTN6VxTvXgiMWdI7Yv aGgIpyrDB6GX0KPMORveM2j3c4unuV9QW35qHUoNFVHu1ttkMuW4POXGQYLEOk5SDRXQ Q8VKstpyeGZxMqflUBZMcVYk2jkHVt0C2uoi3btQGKU3cQarjgNpEFCx+qDmBT4api7+ 0/+g== X-Gm-Message-State: APjAAAVZWl/gwPOh6+V+mKqe0lx126HXj2CjE0VP/tRq9K4pQIpMM27Z JH49uo+7zyG7sdGTxXjogq51RkQcExArQA== X-Google-Smtp-Source: APXvYqwS4UiC+MmpGo+6rjSAlol7cEKllepmdnx8SjIE1K52nq9PtY3cOaAe+9l5iP1HDYaTv6DlZw== X-Received: by 2002:a0c:8924:: with SMTP id 33mr16552908qvp.83.1552074928268; Fri, 08 Mar 2019 11:55:28 -0800 (PST) Received: from ziepe.ca ([24.137.65.181]) by smtp.gmail.com with ESMTPSA id z6sm5182223qtb.67.2019.03.08.11.55.23 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 08 Mar 2019 11:55:23 -0800 (PST) Received: from jgg by mlx.ziepe.ca with local (Exim 4.90_1) (envelope-from ) id 1h2LaU-0000vk-FO; Fri, 08 Mar 2019 15:55:22 -0400 From: Jason Gunthorpe To: linux-rdma@vger.kernel.org Cc: Jason Gunthorpe Subject: [PATCH ibdiags 08/14] ibdiags: Use a static inline for the empty debug Date: Fri, 8 Mar 2019 15:55:09 -0400 Message-Id: <20190308195515.3408-9-jgg@ziepe.ca> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190308195515.3408-1-jgg@ziepe.ca> References: <20190308195515.3408-1-jgg@ziepe.ca> MIME-Version: 1.0 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Jason Gunthorpe So that format checking still works when not compiling for debug. Fixes the compiler warning: warning: suggest braces around empty body in an ‘if’ statement [-Wempty-body] Signed-off-by: Jason Gunthorpe --- src/mcm_rereg_test.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/mcm_rereg_test.c b/src/mcm_rereg_test.c index 183ebd5bcccd0d..95aded688aabde 100644 --- a/src/mcm_rereg_test.c +++ b/src/mcm_rereg_test.c @@ -51,7 +51,10 @@ #ifdef NOISY_DEBUG #define dbg(fmt, ...) fprintf(stderr, "DBG: " fmt, ## __VA_ARGS__ ) #else -#define dbg(fmt, ...) +__attribute__((format(printf, 1, 2))) static inline void dbg(const char *fmt, + ...) +{ +} #endif #define TMO 100