From nobody Sat Feb 7 08:59:31 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6F0C9C433F5 for ; Mon, 23 May 2022 17:34:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241148AbiEWRet (ORCPT ); Mon, 23 May 2022 13:34:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240630AbiEWRZD (ORCPT ); Mon, 23 May 2022 13:25:03 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 28E071CB26; Mon, 23 May 2022 10:12:37 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id C381F614CC; Mon, 23 May 2022 17:12:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C6B1FC385A9; Mon, 23 May 2022 17:12:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1653325956; bh=db0bn8cymktHvmduNfZ39OYCAVGbmotRIWLE2wPYw7c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=L9ICoUOfdbfXfb8xZZZUey/IBYuQlzvueITsRRz7UaR+p6A5kFj/l7ibZmanX6t28 gXg4N4NtJHPFmRqRt4pKsv2QcDrU2huR+Gg3obocLfdU98fXsDc3FH3ZWQ9wGtYFHl 24iwhqH3pHx2lmUT8vLuUiArfA0HHapLIiAOEJUc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Namhyung Kim , Thomas Richter , Heiko Carstens , Sumanth Korikkar , Sven Schnelle , Vasily Gorbik , Arnaldo Carvalho de Melo , Sasha Levin Subject: [PATCH 4.19 36/44] perf bench numa: Address compiler error on s390 Date: Mon, 23 May 2022 19:05:20 +0200 Message-Id: <20220523165759.773361408@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220523165752.797318097@linuxfoundation.org> References: <20220523165752.797318097@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Thomas Richter [ Upstream commit f8ac1c478424a9a14669b8cef7389b1e14e5229d ] The compilation on s390 results in this error: # make DEBUG=3Dy bench/numa.o ... bench/numa.c: In function =E2=80=98__bench_numa=E2=80=99: bench/numa.c:1749:81: error: =E2=80=98%d=E2=80=99 directive output may be= truncated writing between 1 and 11 bytes into a region of size between 10 and 20 [-Werror=3Dformat-truncation=3D] 1749 | snprintf(tname, sizeof(tname), "process%d:thread%d", p, t); ^~ ... bench/numa.c:1749:64: note: directive argument in the range [-2147483647, 2147483646] ... # The maximum length of the %d replacement is 11 characters because of the negative sign. Therefore extend the array by two more characters. Output after: # make DEBUG=3Dy bench/numa.o > /dev/null 2>&1; ll bench/numa.o -rw-r--r-- 1 root root 418320 May 19 09:11 bench/numa.o # Fixes: 3aff8ba0a4c9c919 ("perf bench numa: Avoid possible truncation when u= sing snprintf()") Suggested-by: Namhyung Kim Signed-off-by: Thomas Richter Cc: Heiko Carstens Cc: Sumanth Korikkar Cc: Sven Schnelle Cc: Vasily Gorbik Link: https://lore.kernel.org/r/20220520081158.2990006-1-tmricht@linux.ibm.= com Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Sasha Levin --- tools/perf/bench/numa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf/bench/numa.c b/tools/perf/bench/numa.c index 91c0a4434da2..e7fde88a0845 100644 --- a/tools/perf/bench/numa.c +++ b/tools/perf/bench/numa.c @@ -1631,7 +1631,7 @@ static int __bench_numa(const char *name) "GB/sec,", "total-speed", "GB/sec total speed"); =20 if (g->p.show_details >=3D 2) { - char tname[14 + 2 * 10 + 1]; + char tname[14 + 2 * 11 + 1]; struct thread_data *td; for (p =3D 0; p < g->p.nr_proc; p++) { for (t =3D 0; t < g->p.nr_threads; t++) { --=20 2.35.1