Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp1763734rda; Tue, 24 Oct 2023 02:29:39 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHOLUi1/QaGamefNn++uUz4jBEinafcqjS/ThE+kZsZ8nEvoHpR7h3PoJJYfq+Ox6eL2zce X-Received: by 2002:a05:6359:3509:b0:168:e0e9:86bf with SMTP id un9-20020a056359350900b00168e0e986bfmr4331757rwb.14.1698139779043; Tue, 24 Oct 2023 02:29:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698139779; cv=none; d=google.com; s=arc-20160816; b=WuZCzRuyNoD6FlJkVf4blfA8thrN5lFhz3Cjg5MGoCe5QM/5f8xI0csxLqLTYKHxz2 cV2DdgV8i+C9B5JtuXYPXhqKkNJXcfkPwNG/IAWv+BR63zvJkGlSyQETcDQ/5E8/cKsy mN+C3tOR1DpBHbaXRuhrE7UlakbpdgsD8S6XXu3IpLC/zAKfPssBStOyRLEMLZI/deq5 QMkM6vQsfNbl4Maoz6yZNQ5PjEnPtEphH6fJk8yY7kUbo9tF+yEG+hA2TulOBf3lCav/ LMPWcO8gvvCqEWUz7GCICrAK/RH6VyxQqWfPErv6tdwO3AEZYUxpnj0zqapphTUVKnFM Vshw== 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=iX00C25aX18+BpG8rP40uJnVD1fjjjB8G8FjH6yBTiw=; fh=gPQ6jqLSfsDb5bE3yrtO+AlT5R4d75RXkjC5xckz7Dk=; b=W1eMMsIHaa7QuDJGuYbzWJ4VnvKLWZYzmo+6lJoORch/srwvHxhfTnIlD7wIgSGn2f BRBLJzCcmemHFGjVA4+vdZ4I4iLKCgj6EfNjENcbBTL12AySRU+V7O6OQCT8fGYGt1uB VQmGz1WNMlyRO2TveIP93vI7JW7duC/fdPxx16fZL4gtPV7LKndi+UlMRUPbeFUeQYiJ lr33yrtgqVhufwRa33ea0eE2WpQzU+LTXm2ReWHPSB/dBG+ByTObONBw4lohYbeopXRz zXvKsBbkHjwcwYhvTgjRT/5KIXHR1L45AhRqhar5tlNYIizPkjVzYpCFSlzwOFyKQs3C /a6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=VtCDMOwO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 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 pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id b26-20020a63931a000000b0056fa1ac3722si8039310pge.698.2023.10.24.02.29.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Oct 2023 02:29:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=VtCDMOwO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 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 pete.vger.email (Postfix) with ESMTP id F40CA8041EC8; Tue, 24 Oct 2023 02:29:17 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234129AbjJXJ2F (ORCPT + 99 others); Tue, 24 Oct 2023 05:28:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53392 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234152AbjJXJ1q (ORCPT ); Tue, 24 Oct 2023 05:27:46 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CEB861998; Tue, 24 Oct 2023 02:27:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1698139642; x=1729675642; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=+4ID6L9EUqCaz0idLUa+6bfvdG7Emg+ZFtrDA3juAok=; b=VtCDMOwOJNxAxY4IR0rl7wXHYscM7XjF/Lpk/+Q0qpilUNMX0DK7Hg+S 8UBevG+kLoM5Cu1KlCLNLlFZJI/E9sT6cNmWhPIIfQRduz1WwJ/57B7rl PQmGXt12n6tX8AZ9C/1LKU+HlkmeUOeZnilxABbRUrgBxokIbhUV2JYmT 566ABM5EcNPgGayuSS8qZmkihid94fNufvxhvumOQJYqHhX61+3uj3Cpm kbJ8NX6azzXb7CexaxfITBG5fAb3jBE0hFTdZCjxg4CZH4OhRUaqm83Ju OPRoOwUKuyZgRJXIOBY8goGKW8NaHRWKJGdkS4fRpalewdfjKJJdu5sxj Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10872"; a="366363898" X-IronPort-AV: E=Sophos;i="6.03,247,1694761200"; d="scan'208";a="366363898" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Oct 2023 02:27:22 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10872"; a="882061150" X-IronPort-AV: E=Sophos;i="6.03,247,1694761200"; d="scan'208";a="882061150" Received: from hprosing-mobl.ger.corp.intel.com (HELO localhost) ([10.249.40.219]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Oct 2023 02:27:18 -0700 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 04/24] selftests/resctrl: Mark get_cache_size() cache_type const Date: Tue, 24 Oct 2023 12:26:14 +0300 Message-Id: <20231024092634.7122-5-ilpo.jarvinen@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20231024092634.7122-1-ilpo.jarvinen@linux.intel.com> References: <20231024092634.7122-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 autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.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 (pete.vger.email [0.0.0.0]); Tue, 24 Oct 2023 02:29:18 -0700 (PDT) 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 e95121a113f3..2f3f0ee439d8 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_cbm_mask(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 220dc83748ca..46fb0441818d 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