Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp2107839ioo; Mon, 23 May 2022 10:13:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxjIyMdVXl/oS0WlM9BQRgnF5b+5rCnJ1+zpc3vJRsHBgXnR2BxC7GZtW6lojLLgBJhGMvJ X-Received: by 2002:a17:902:ec04:b0:161:8644:c663 with SMTP id l4-20020a170902ec0400b001618644c663mr23109942pld.134.1653325989737; Mon, 23 May 2022 10:13:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653325989; cv=none; d=google.com; s=arc-20160816; b=tALngMSBQBd0M2c2W1eWrEEJz2EKUAC6y6B8EIivOkt2EuLZ7BuA30HWcPhDHA5dPs imJrygpstD2cNOiGOdRHV3FY+qsL1lgRWRq41ljR3N2Qz6F4NQG2VkJ1iJU0m1bG7Sto fB4fTsEjesei5TCtI637BTfxQCYBxpfZlR+SdhKL4FE+t8o32L5w0rBXF9HDzP4pCsgm SRVHYRg3a5zbJl5l8OSf5HLngYBI8OcQ5x//3zZ+9zpxLsTbyw2Fq+oIYAmAixhEQbOB k2t8FMeuctjEKDrF/Ot1gl+WFysybU2AMvClCncqWZxdX9ch6I9MNeDsekcV9b899qnt mZaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=hUkkmWciD/b5pXERLOn73/BjXUrQ3WMaDE35Ee/lWY8=; b=pIjksUMAr/eQXSQ2UsrkH1zX9TO+RN5nagVTjO/wUAJELhS+DEkuw24uuq8xgQNGk8 Ttr+UJjYkGWKGoSXqc7gyj45h9p4gYrbwBcRLNnTKsuZyRMNiQ4tRJ2/eMwpaBs1mvpA by+KbbHPZ5t0mBdqubgOr4ItBzyav24RHlul8R9tXnpvenlykwfG+RnhKXvbyf96MGqd YIsQT6awaDVSFjJ4KGIs8vPbqHjd6ZCVJR4iFJumc29pWED1qiN8XkoF3AVAFTFXR+Sm Es9zHy6o1+Qeqy8euePxCFoGOrC1TjibIceH1IBG3zFBGhzzSHKMLfEOi5b/p0jI7EPT 0tpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=FAMlPRvL; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id v2-20020a1709029a0200b00162188be343si6742646plp.264.2022.05.23.10.13.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 May 2022 10:13:09 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=FAMlPRvL; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 3E73059306; Mon, 23 May 2022 10:12:45 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239513AbiEWRJ6 (ORCPT + 99 others); Mon, 23 May 2022 13:09:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37778 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239643AbiEWRJW (ORCPT ); Mon, 23 May 2022 13:09:22 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2AF4E6CF42; Mon, 23 May 2022 10:08:57 -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 ams.source.kernel.org (Postfix) with ESMTPS id A01B8B811FE; Mon, 23 May 2022 17:08:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D1C60C385A9; Mon, 23 May 2022 17:08:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1653325734; bh=Rs7XVx/DYICMBYAy2TqNBhcC7rSquXFFayQ1znVgDgk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FAMlPRvLT0c/JfMl54tSw6PlKZXE8aaQiyp5GF5uNABpuJMKeoPS3z/vQGom2TpiF HtAeOCxBTQymR1KSPRyylt/KmuVVsH/FzXwcu/Hne8WNTq6lsxvHXsnrI8SO9t091s WG4QXd8hJvY9CRal3Cdi5Mdfpd3L9GGMqwU/XyVU= 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.14 26/33] perf bench numa: Address compiler error on s390 Date: Mon, 23 May 2022 19:05:15 +0200 Message-Id: <20220523165752.700602925@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220523165746.957506211@linuxfoundation.org> References: <20220523165746.957506211@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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=y bench/numa.o ... bench/numa.c: In function ‘__bench_numa’: bench/numa.c:1749:81: error: ‘%d’ directive output may be truncated writing between 1 and 11 bytes into a region of size between 10 and 20 [-Werror=format-truncation=] 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=y 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 using 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 275f1c3c73b6..4334f2af15fa 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"); if (g->p.show_details >= 2) { - char tname[14 + 2 * 10 + 1]; + char tname[14 + 2 * 11 + 1]; struct thread_data *td; for (p = 0; p < g->p.nr_proc; p++) { for (t = 0; t < g->p.nr_threads; t++) { -- 2.35.1