Received: by 2002:a05:7412:b130:b0:e2:908c:2ebd with SMTP id az48csp2140827rdb; Mon, 20 Nov 2023 03:16:18 -0800 (PST) X-Google-Smtp-Source: AGHT+IFYJGn3ATEHkMpa3uX+/aHmMVYJvR+wWQW9Ylp0doXXbZ+Qpzpmgr1VPIrYDNsrq0g0YPQd X-Received: by 2002:a17:90a:f3c8:b0:283:9b90:3650 with SMTP id ha8-20020a17090af3c800b002839b903650mr4676531pjb.19.1700478978210; Mon, 20 Nov 2023 03:16:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700478978; cv=none; d=google.com; s=arc-20160816; b=KoI5U8p1b9HVAXK4K2vpdViFsVK4cRUqQo0UHKl89QbI3atMhtG1OtML/CgUUHfGZX nsjoGBs92QRCw3ko3EUZBP1IxUOpEcZJc26l5XuDwaG7PkahhcNZxsjBjg6MpENBOgNA SZjfDbV46kbe8Au28nhpqH9300scA4661FVuxOVhK52zJSXv502AsOcWGEkmftZulucI c5CQZzvmex6V+LdZ1snFA2UKjVMmrDcN4cINfDmiunxvzvsIwBwMSM/Dprj9Xz2+7bj4 KZl8KxR2jtVyoXhphvT7OjIuNZJnY3uf/zAjFA91Dso/ItzVjaF2bMkeVBj6MD5aDCYv hrHA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Td491pgzqsks3Po4uR9urVSXVgf/eMNPkUc37tAY7XY=; fh=gPQ6jqLSfsDb5bE3yrtO+AlT5R4d75RXkjC5xckz7Dk=; b=C4wvxsRiX9a8JHO9Q68jfh74G1uWjLuelP3kjs0q8A7onTbT+30oIFYnaTxYRKC/Wr Zo5WTg4rtaF2qUht3ObLdNNOQ1fBy8sccZOQrADCDaXb7Z/hdLPFcD5P+eIbCNAkrBKP b4W0HRBl8YPMdfXt0Vy2Ivk/nD5RkGIWku5N2VTDjpnI2t5PuH4+b0mTZMrVRQD9B35m 4AJS1RmPA3pASzKvt1oQ4vZxZ66N/e1kX+TJEfIjip0CqE7fFeFRSqzVklcvZ+NK+5NR +D4y9Wz915GM4InUs6pSK82oXYCVUn2JB4ox52L4PwE2fuE3ujKSMwCLrd3wi2yhrEAP sPUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="i0w51w/e"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id ga20-20020a17090b039400b0026d41496190si10345165pjb.85.2023.11.20.03.16.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Nov 2023 03:16:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="i0w51w/e"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 142498061379; Mon, 20 Nov 2023 03:15:16 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233199AbjKTLOp (ORCPT + 99 others); Mon, 20 Nov 2023 06:14:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36414 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233058AbjKTLOj (ORCPT ); Mon, 20 Nov 2023 06:14:39 -0500 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9321AE3; Mon, 20 Nov 2023 03:14:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1700478875; x=1732014875; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=vJ/eQhSvr2090GXHqueS1VlGnJy7feZQHUaQho+s3vE=; b=i0w51w/eABbM+Ye5kreDuO42MbfyLxphtQwpOxmLlyZso3mDNJLHRU19 CauPh2EiMHysHpTu1RHDt4BkHeHAxNRqB2jC2xscQoqlJDz8RmyQ3eSuT UTWvOlJSpYsKj71nXqKtgibcl3aNx3OE8lEsb67ltYCUvWvuMsnfOxhtH OiljMST4J4hNVQtPTERRZWnlWEmU/KpXNx5YFQnF57mtCnzqioouT4nJ7 60LgFLq2p1xUUreGYiw3MAMEx9yaRN7Pq+gSntwagjUZtMyVq4RNtHBkq zwh27eElpMFF1/kNYXaIoQTwtBsLAplvXWBQloIG1n7YX/lQn/AgCU1Ta w==; X-IronPort-AV: E=McAfee;i="6600,9927,10899"; a="381987317" X-IronPort-AV: E=Sophos;i="6.04,213,1695711600"; d="scan'208";a="381987317" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Nov 2023 03:14:35 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10899"; a="742696030" X-IronPort-AV: E=Sophos;i="6.04,213,1695711600"; d="scan'208";a="742696030" Received: from sc9itsct4906.amr.corp.intel.com (HELO localhost) ([10.249.46.107]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Nov 2023 03:14:31 -0800 From: =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= To: linux-kselftest@vger.kernel.org, Reinette Chatre , Shuah Khan , Shaopeng Tan , =?UTF-8?q?Maciej=20Wiecz=C3=B3r-Retman?= , Fenghua Yu Cc: linux-kernel@vger.kernel.org, =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= Subject: [PATCH v2 05/26] selftests/resctrl: Mark get_cache_size() cache_type const Date: Mon, 20 Nov 2023 13:13:19 +0200 Message-Id: <20231120111340.7805-6-ilpo.jarvinen@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20231120111340.7805-1-ilpo.jarvinen@linux.intel.com> References: <20231120111340.7805-1-ilpo.jarvinen@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,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 fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Mon, 20 Nov 2023 03:15:16 -0800 (PST) get_cache_size() does not modify cache_type so it could be const. Mark cache_type const so that const char * can be passed to it. This prevents warnings once many of the test parameters are marked const. Signed-off-by: Ilpo Järvinen --- tools/testing/selftests/resctrl/resctrl.h | 2 +- tools/testing/selftests/resctrl/resctrlfs.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/resctrl/resctrl.h b/tools/testing/selftests/resctrl/resctrl.h index 7a2b4da684ed..62bad95ea7d0 100644 --- a/tools/testing/selftests/resctrl/resctrl.h +++ b/tools/testing/selftests/resctrl/resctrl.h @@ -100,7 +100,7 @@ void mbm_test_cleanup(void); int mba_schemata_change(int cpu_no, const char * const *benchmark_cmd); void mba_test_cleanup(void); int get_full_cbm(const char *cache_type, unsigned long *mask); -int get_cache_size(int cpu_no, char *cache_type, unsigned long *cache_size); +int get_cache_size(int cpu_no, const char *cache_type, unsigned long *cache_size); void ctrlc_handler(int signum, siginfo_t *info, void *ptr); int signal_handler_register(void); void signal_handler_unregister(void); diff --git a/tools/testing/selftests/resctrl/resctrlfs.c b/tools/testing/selftests/resctrl/resctrlfs.c index 211fc7647659..1ea610fa65b1 100644 --- a/tools/testing/selftests/resctrl/resctrlfs.c +++ b/tools/testing/selftests/resctrl/resctrlfs.c @@ -138,7 +138,7 @@ int get_resource_id(int cpu_no, int *resource_id) * * Return: = 0 on success, < 0 on failure. */ -int get_cache_size(int cpu_no, char *cache_type, unsigned long *cache_size) +int get_cache_size(int cpu_no, const char *cache_type, unsigned long *cache_size) { char cache_path[1024], cache_str[64]; int length, i, cache_num; -- 2.30.2