From patchwork Thu Mar 21 17:24:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 10864149 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 2F67C1823 for ; Thu, 21 Mar 2019 17:24:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0C2E82A206 for ; Thu, 21 Mar 2019 17:24:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F41F72A22E; Thu, 21 Mar 2019 17:24:33 +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=-7.9 required=2.0 tests=BAYES_00,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 98AB82A253 for ; Thu, 21 Mar 2019 17:24:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727921AbfCURYd (ORCPT ); Thu, 21 Mar 2019 13:24:33 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:45222 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728445AbfCURYc (ORCPT ); Thu, 21 Mar 2019 13:24:32 -0400 Received: by mail-pg1-f193.google.com with SMTP id y3so4633752pgk.12 for ; Thu, 21 Mar 2019 10:24:32 -0700 (PDT) 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=o+rE3CvE6WSbk1gIyjN1BHjU7/y+I6C0I7Q8u0MyAtg=; b=nqirm/txco4hT0C5xWfaqivvNbwMraOraK6dQmn63K0WV7FC1nctU2jlzYhkdvVMvQ uCQWZip2EMFYWlxkHSEri1X8AHOpjFq4IjeC7PhG7pc+dmqCYMKg+hxPpPVCv+drFmF8 KJ6U45wVNCgvO0v7R5Hf8shzYCTxPRpBDDNY4/Mv9prl3By/dImV0X3QkBPt728MCr0m ZwCkFUMTOtbHjQxaf+LAZzFp0LMR+ZeBIPmmyZAayKg71Img0TfmNl7CIqw8B3kAHNGE X7WPqBy33zl3Zqrwe4DfsQ3iIctLP6FTdXUWwRfg1V/0gYa9tTMEZdlUDGpYdx863fOi icdQ== X-Gm-Message-State: APjAAAWdmlX7VP1uZa2JEV8ljNS2tF6uWJQhZnkmUHzuYxi0Vq0MD+fH KSuaEBjxvJF8dVIG4AFi3zg= X-Google-Smtp-Source: APXvYqxAhPSb0pYzKaHRLiWV8NOliMJAX5t7VCJusNZftzh0RXCCTsLaImmwxnc774zkqObIFKFD/A== X-Received: by 2002:a63:4e57:: with SMTP id o23mr4139113pgl.368.1553189072218; Thu, 21 Mar 2019 10:24:32 -0700 (PDT) Received: from desktop-bart.svl.corp.google.com ([2620:15c:2cd:203:5cdc:422c:7b28:ebb5]) by smtp.gmail.com with ESMTPSA id s184sm7528549pfb.1.2019.03.21.10.24.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Mar 2019 10:24:31 -0700 (PDT) From: Bart Van Assche To: Jason Gunthorpe Cc: Leon Romanovsky , Doug Ledford , linux-rdma@vger.kernel.org, Bart Van Assche , Mike Marciniszyn , Dennis Dalessandro Subject: [PATCH 7/8] IB/hfi1: Fix two format strings Date: Thu, 21 Mar 2019 10:24:16 -0700 Message-Id: <20190321172417.77869-8-bvanassche@acm.org> X-Mailer: git-send-email 2.20.GIT In-Reply-To: <20190321172417.77869-1-bvanassche@acm.org> References: <20190321172417.77869-1-bvanassche@acm.org> 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 Enable format string checking for hfi1_cdbg() and fix the resulting compiler warnings. Cc: Mike Marciniszyn Cc: Dennis Dalessandro Signed-off-by: Bart Van Assche --- drivers/infiniband/hw/hfi1/init.c | 4 ++-- drivers/infiniband/hw/hfi1/trace_dbg.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/infiniband/hw/hfi1/init.c b/drivers/infiniband/hw/hfi1/init.c index faaaac8fbc55..3c339617aa95 100644 --- a/drivers/infiniband/hw/hfi1/init.c +++ b/drivers/infiniband/hw/hfi1/init.c @@ -469,7 +469,7 @@ int hfi1_create_ctxtdata(struct hfi1_pportdata *ppd, int numa, if (rcd->egrbufs.size < hfi1_max_mtu) { rcd->egrbufs.size = __roundup_pow_of_two(hfi1_max_mtu); hfi1_cdbg(PROC, - "ctxt%u: eager bufs size too small. Adjusting to %zu\n", + "ctxt%u: eager bufs size too small. Adjusting to %u\n", rcd->ctxt, rcd->egrbufs.size); } rcd->egrbufs.rcvtid_size = HFI1_MAX_EAGER_BUFFER_SIZE; @@ -2071,7 +2071,7 @@ int hfi1_setup_eagerbufs(struct hfi1_ctxtdata *rcd) rcd->egrbufs.size = alloced_bytes; hfi1_cdbg(PROC, - "ctxt%u: Alloced %u rcv tid entries @ %uKB, total %zuKB\n", + "ctxt%u: Alloced %u rcv tid entries @ %uKB, total %uKB\n", rcd->ctxt, rcd->egrbufs.alloced, rcd->egrbufs.rcvtid_size / 1024, rcd->egrbufs.size / 1024); diff --git a/drivers/infiniband/hw/hfi1/trace_dbg.h b/drivers/infiniband/hw/hfi1/trace_dbg.h index e62171fb7379..de7a87392b8d 100644 --- a/drivers/infiniband/hw/hfi1/trace_dbg.h +++ b/drivers/infiniband/hw/hfi1/trace_dbg.h @@ -86,14 +86,14 @@ DECLARE_EVENT_CLASS(hfi1_trace_template, * actual function to work and can not be in a macro. */ #define __hfi1_trace_def(lvl) \ -void __hfi1_trace_##lvl(const char *funct, char *fmt, ...); \ +void __printf(2, 3) __hfi1_trace_##lvl(const char *funct, char *fmt, ...); \ \ DEFINE_EVENT(hfi1_trace_template, hfi1_ ##lvl, \ TP_PROTO(const char *function, struct va_format *vaf), \ TP_ARGS(function, vaf)) #define __hfi1_trace_fn(lvl) \ -void __hfi1_trace_##lvl(const char *func, char *fmt, ...) \ +void __printf(2, 3) __hfi1_trace_##lvl(const char *func, char *fmt, ...)\ { \ struct va_format vaf = { \ .fmt = fmt, \