From patchwork Mon Nov 20 11:13:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ilpo_J=C3=A4rvinen?= X-Patchwork-Id: 167062 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9910:0:b0:403:3b70:6f57 with SMTP id i16csp2125275vqn; Mon, 20 Nov 2023 03:16:30 -0800 (PST) X-Google-Smtp-Source: AGHT+IGFxVEvnqh5JUe30DQ9mKHOGBJkPu23EBMr8M64MEVlD2ybdi2vU2ybHsZSW+fuD6TPznF2 X-Received: by 2002:a17:902:b417:b0:1cc:56b3:efc5 with SMTP id x23-20020a170902b41700b001cc56b3efc5mr4624825plr.21.1700478990535; Mon, 20 Nov 2023 03:16:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700478990; cv=none; d=google.com; s=arc-20160816; b=zbyoQ5eGTY3UD/1Gj/JRNApQxf2x/7GMEMWb/M6aQtSGA0aQxCAt755DTIFh3X/5HP Bn37kODIhKIxaBzTbPCfDgKXZYgifQaWQnzKLaxjXmhSDD6du+hgq4LzTULwUEz1tIgi SsbyWbCG97B9Xj+ZRB6FzVr00TKsr8rdjV2SdXuhsPFrGMZWabItpaAdsfmiYZ5u+g9j Oh+z770wRQgbbQboMxOU29kwuMy+bU++/g/s17LrPvNozAoqDZAZhiWZIc7T7Oo3zuaK Sp6XOc5xvDuR7DqEymQORPG3UyjnNnsJWbp/82cnuMgZ1G58SezlfyrQLbluLalosnZE I32A== 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 23.128.96.38 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 fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id k5-20020a170902ce0500b001cc45fcb81fsi8608159plg.334.2023.11.20.03.16.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Nov 2023 03:16:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; 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 23.128.96.38 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 1A3EA80A64E1; Mon, 20 Nov 2023 03:16:18 -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 S232924AbjKTLOq (ORCPT + 27 others); Mon, 20 Nov 2023 06:14:46 -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_J=C3=A4rvinen?= To: linux-kselftest@vger.kernel.org, Reinette Chatre , Shuah Khan , Shaopeng Tan , =?utf-8?q?Maciej_Wiecz=C3=B3r-R?= =?utf-8?q?etman?= , Fenghua Yu Cc: linux-kernel@vger.kernel.org, =?utf-8?q?Ilpo_J=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 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:16:18 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783081458137201995 X-GMAIL-MSGID: 1783081458137201995 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 Reviewed-by: Reinette Chatre --- 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;