From patchwork Wed Mar 27 23:50:50 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: 10874365 X-Patchwork-Delegate: jgg@ziepe.ca 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 78E7F14DE for ; Wed, 27 Mar 2019 23:51:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6503528C9A for ; Wed, 27 Mar 2019 23:51:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5987828CE6; Wed, 27 Mar 2019 23:51: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=-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 4F4E728D2D for ; Wed, 27 Mar 2019 23:51:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732026AbfC0XvL (ORCPT ); Wed, 27 Mar 2019 19:51:11 -0400 Received: from mail-pg1-f195.google.com ([209.85.215.195]:41284 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725948AbfC0XvL (ORCPT ); Wed, 27 Mar 2019 19:51:11 -0400 Received: by mail-pg1-f195.google.com with SMTP id f6so6567248pgs.8 for ; Wed, 27 Mar 2019 16:51:10 -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=JbLUE4ZeBEtatzErzBJZhBCMs3X1iVUG8n999WlHOqM=; b=fC118hWWGLUbeft4XbWqaoK/rao0MTo9Dw/76d3LR+Oy/IgCDONJmjxPY4FWk4gryX t/5mRWycOxYzn5L9aUEvrUI8AUTNQKtdmeJg82/UrWEy4nGJSPEibyduAqwSo6plOwxk UCf6luIMfiLMLS5JlOmB6bQnYM+5LNRHhYW91h9ALbgrbWtXlVbDyZHlWPZgqxH0Bt0R C31l6jvb1Y2Zq8ARuIORVFzQ3Y8jwxnO5nqdajWatNWy1f7uP3GQRh2a+68Ic+2oHbmy uT7dVizuvX9WbiEc6USaCwA1oDw+Z7cO4VWlwy6frnue3fQiRMJQJ3ziU9WN8n1EbwS0 9Gsg== X-Gm-Message-State: APjAAAXpyJAB0LOj/+gLPL/cJ6A8BBn9qHOS1d21C3KXiGQfdiWz7lH/ iMlwIDEiZYHlwf+GSp+HJLQ= X-Google-Smtp-Source: APXvYqw6F/hIHGHUMa9I/s8GDwUjbU5y7eUiMfwYNEmu6yAQKCRNTLn/wMrZ11rCJkdXyYpikCOLKA== X-Received: by 2002:a63:66c1:: with SMTP id a184mr36990352pgc.60.1553730670271; Wed, 27 Mar 2019 16:51:10 -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 a3sm16493115pfn.182.2019.03.27.16.51.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 27 Mar 2019 16:51:09 -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 v2 6/7] IB/hfi1: Fix two format strings Date: Wed, 27 Mar 2019 16:50:50 -0700 Message-Id: <20190327235051.67361-7-bvanassche@acm.org> X-Mailer: git-send-email 2.20.GIT In-Reply-To: <20190327235051.67361-1-bvanassche@acm.org> References: <20190327235051.67361-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, \