From patchwork Tue Nov 21 18:49:26 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?VmlsbGUgU3lyasOkbMOk?= X-Patchwork-Id: 10068757 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id EDEE86038F for ; Tue, 21 Nov 2017 18:49:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E0D6A298B0 for ; Tue, 21 Nov 2017 18:49:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D5283298FB; Tue, 21 Nov 2017 18:49:37 +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=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id DBB27298B0 for ; Tue, 21 Nov 2017 18:49:36 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 180236E565; Tue, 21 Nov 2017 18:49:36 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTPS id E8A6D6E565 for ; Tue, 21 Nov 2017 18:49:34 +0000 (UTC) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Nov 2017 10:49:33 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos; i="5.44,432,1505804400"; d="scan'208"; a="1246937978" Received: from stinkbox.fi.intel.com (HELO stinkbox) ([10.237.72.174]) by fmsmga002.fm.intel.com with SMTP; 21 Nov 2017 10:49:31 -0800 Received: by stinkbox (sSMTP sendmail emulation); Tue, 21 Nov 2017 20:49:30 +0200 From: Ville Syrjala To: intel-gfx@lists.freedesktop.org Date: Tue, 21 Nov 2017 20:49:26 +0200 Message-Id: <20171121184930.25826-1-ville.syrjala@linux.intel.com> X-Mailer: git-send-email 2.13.6 MIME-Version: 1.0 Cc: Dhinakaran Pandiyan Subject: [Intel-gfx] [PATCH i-g-t 1/5] tools/intel_watermark: Silence gcc7 snprintf() warnings X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP From: Ville Syrjälä Bump the snprintf() buffer size to 32 bytes to silence gcc. intel_watermark.c:203:57: warning: ‘%c’ directive output may be truncated writing 1 byte into a region of size between 0 and 9 [-Wformat-truncation=] snprintf(reg_name, sizeof(reg_name), "PLANE_WM_%1d_%c_%1d", ^~ intel_watermark.c:203:43: note: directive argument in the range [0, 8] snprintf(reg_name, sizeof(reg_name), "PLANE_WM_%1d_%c_%1d", ^~~~~~~~~~~~~~~~~~~~~ etc. Cc: Dhinakaran Pandiyan Cc: Tvrtko Ursulin Reported-by: Tvrtko Ursulin Signed-off-by: Ville Syrjälä Reviewed-by: Tvrtko Ursulin Tested-by: Tvrtko Ursulin --- tools/intel_watermark.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/intel_watermark.c b/tools/intel_watermark.c index c09772eea334..1d087b49f8c2 100644 --- a/tools/intel_watermark.c +++ b/tools/intel_watermark.c @@ -163,7 +163,7 @@ static void skl_wm_dump(void) uint32_t wm_trans[num_pipes][max_planes]; uint32_t buf_cfg[num_pipes][max_planes]; uint32_t wm_linetime[num_pipes]; - char reg_name[20]; + char reg_name[32]; intel_register_access_init(intel_get_pci_device(), 0, -1);