Received: by 2002:a05:7412:bb8d:b0:d7:7d3a:4fe2 with SMTP id js13csp909170rdb; Tue, 15 Aug 2023 16:23:10 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG1xlGxPwQcmykjc16Ps/U89J1QCwe+duEb2P/3WWISR2bAy8nzMojLF4LfQUt+B/yeeO/p X-Received: by 2002:a17:90b:784:b0:26b:9e2:1298 with SMTP id l4-20020a17090b078400b0026b09e21298mr53535pjz.11.1692141790515; Tue, 15 Aug 2023 16:23:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692141790; cv=none; d=google.com; s=arc-20160816; b=I7QiI+TDvVw29NCMVWqNj53fRdU2qDtNeuFSAtarzUUrahGn2yujkKuD5U0j89i0dS fl3SWRIc9f3xNSOCl9NvXaviNEy2ksHiR3QZf1KS8ZP/hZy0XwgMW7sSXJ9cYtMYayZp tBe1u1RtVQyE4QSUAa6yj+X+r319sB0laJlhoBgigA1V/HlXQpZXF+mHNNbTOyc81SbZ pHMgSG9iCqq03Teps9Yaa3UUFjzBrkn6hpWHa47PQLAf/0FgEIiO5lMBwOAZau6urMnO vlwQKOccYxvoAoC/Zu125o2zk00/WthDmXLsTeRN+fwt5tuhqxePp2WtQPcFm07rNUaQ 5pyw== 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; bh=tXCPTU67nHHJh2NBnPH7qe9rwLgbiu4LYOJdDZZMm4o=; fh=UBrbDth7y5oMgl8brvefl9eZ6RQ3QXA6llOLfOqxpDM=; b=nMX13x6LDsJg1JDjCfZrc7+SEuWM8OgUd+S32GUiqy9OxdPeLSUZFUlj6jLjDlL/h+ 31+0c+SaT0hXr4N0UCflrEQk0/D+2PxoJNA9GAXnSdcYFTx6hv202IJ8U//YVvJtJUYH Vh+JR1Jk7e+N3MmJGtAAsuzODY1hbnN+oOqm9zIsLBDiyHiTnbuKJgv5qLzrIhf7pJ2/ InnGBVyIF7WqXt1l3y9TMhgRFyfYWqCm6FG5EA0vhhNfIhzHgeXMGFfu3XmA9bLFPNjQ ZsTSfecKcVJDxloumyM45hcAx/5O/t9P2X7WUnBd32ZICkw+qxypjikEEApB+vdrpWdE rXyA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lx11-20020a17090b4b0b00b00268c19acce2si13222429pjb.38.2023.08.15.16.22.58; Tue, 15 Aug 2023 16:23:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238385AbjHOP5H (ORCPT + 99 others); Tue, 15 Aug 2023 11:57:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41668 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238375AbjHOP4d (ORCPT ); Tue, 15 Aug 2023 11:56:33 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 7B95319B3; Tue, 15 Aug 2023 08:56:32 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 92054143D; Tue, 15 Aug 2023 08:57:14 -0700 (PDT) Received: from donnerap.arm.com (donnerap.manchester.arm.com [10.32.100.58]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 431D13F6C4; Tue, 15 Aug 2023 08:56:31 -0700 (PDT) From: Andre Przywara To: Shuah Khan , Nhat Pham , Johannes Weiner Cc: linux-kselftest@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/3] selftests: cachestat: use proper syscall number macro Date: Tue, 15 Aug 2023 16:56:11 +0100 Message-Id: <20230815155612.2535947-3-andre.przywara@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230815155612.2535947-1-andre.przywara@arm.com> References: <20230815155612.2535947-1-andre.przywara@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE autolearn=ham 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 At the moment the cachestat syscall number is hard coded into the test source code. Remove that and replace it with the proper __NR_cachestat macro. That ensures compatibility should other architectures pick a different number. Signed-off-by: Andre Przywara --- tools/testing/selftests/cachestat/test_cachestat.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tools/testing/selftests/cachestat/test_cachestat.c b/tools/testing/selftests/cachestat/test_cachestat.c index 54d09b820ed4b..a5a4ac8dcb76c 100644 --- a/tools/testing/selftests/cachestat/test_cachestat.c +++ b/tools/testing/selftests/cachestat/test_cachestat.c @@ -19,7 +19,6 @@ static const char * const dev_files[] = { "/dev/zero", "/dev/null", "/dev/urandom", "/proc/version", "/proc" }; -static const int cachestat_nr = 451; void print_cachestat(struct cachestat *cs) { @@ -126,7 +125,7 @@ bool test_cachestat(const char *filename, bool write_random, bool create, } } - syscall_ret = syscall(cachestat_nr, fd, &cs_range, &cs, 0); + syscall_ret = syscall(__NR_cachestat, fd, &cs_range, &cs, 0); ksft_print_msg("Cachestat call returned %ld\n", syscall_ret); @@ -152,7 +151,7 @@ bool test_cachestat(const char *filename, bool write_random, bool create, ksft_print_msg("fsync fails.\n"); ret = false; } else { - syscall_ret = syscall(cachestat_nr, fd, &cs_range, &cs, 0); + syscall_ret = syscall(__NR_cachestat, fd, &cs_range, &cs, 0); ksft_print_msg("Cachestat call (after fsync) returned %ld\n", syscall_ret); @@ -213,7 +212,7 @@ bool test_cachestat_shmem(void) goto close_fd; } - syscall_ret = syscall(cachestat_nr, fd, &cs_range, &cs, 0); + syscall_ret = syscall(__NR_cachestat, fd, &cs_range, &cs, 0); if (syscall_ret) { ksft_print_msg("Cachestat returned non-zero.\n"); -- 2.25.1