From patchwork Mon Dec 9 18:56:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muhammad Usama Anjum X-Patchwork-Id: 13900232 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id B0B8CE77180 for ; Mon, 9 Dec 2024 18:57:00 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3C66B8D00A3; Mon, 9 Dec 2024 13:57:00 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 376808D0058; Mon, 9 Dec 2024 13:57:00 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 23E158D00A3; Mon, 9 Dec 2024 13:57:00 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 0243D8D0058 for ; Mon, 9 Dec 2024 13:56:59 -0500 (EST) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id AFAEA8064B for ; Mon, 9 Dec 2024 18:56:59 +0000 (UTC) X-FDA: 82876326792.19.2B7B0BA Received: from sender4-pp-f112.zoho.com (sender4-pp-f112.zoho.com [136.143.188.112]) by imf16.hostedemail.com (Postfix) with ESMTP id 699F918000D for ; Mon, 9 Dec 2024 18:56:36 +0000 (UTC) Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=collabora.com header.s=zohomail header.b="jU/hGAvy"; arc=pass ("zohomail.com:s=zohoarc:i=1"); spf=pass (imf16.hostedemail.com: domain of usama.anjum@collabora.com designates 136.143.188.112 as permitted sender) smtp.mailfrom=usama.anjum@collabora.com; dmarc=pass (policy=none) header.from=collabora.com ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1733770596; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=RP+RJMd3ZtnBxFIpa2C1GgSta2qA552hwg7OkTPrM7M=; b=AVWV54d/VRbsr88953yR5nn2dfiA4m9tr10oAJRMWv/E/si44PV0zJNiqec9EYISI0FfHG 5vflGuO/DZi90VDAzspzmuqeDkgF/Biw6JihafsOF1+/2PXdeLEQR7CHjBxCHP1LfN9ED1 kguRwD4cVVG0WjSLUxACat6naQ3jwvw= ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1733770596; a=rsa-sha256; cv=pass; b=eZOVbOeTdri+2EZBox1jYlf6XDz6dE397Td5dZ3T/oREJU69/DEKF7pPlhfIaEJ8GUfUnB 6fdqV12icMiTakvHFMkh2h/LETSZmdrc41AA96c3U/Dy8uK79i2Z48FmNoqGcNy/q2rJvN jJ7yAoRK7cLD1d2TuSzhnYy7303VTig= ARC-Authentication-Results: i=2; imf16.hostedemail.com; dkim=pass header.d=collabora.com header.s=zohomail header.b="jU/hGAvy"; arc=pass ("zohomail.com:s=zohoarc:i=1"); spf=pass (imf16.hostedemail.com: domain of usama.anjum@collabora.com designates 136.143.188.112 as permitted sender) smtp.mailfrom=usama.anjum@collabora.com; dmarc=pass (policy=none) header.from=collabora.com ARC-Seal: i=1; a=rsa-sha256; t=1733770601; cv=none; d=zohomail.com; s=zohoarc; b=J1b3J2MBW2s5pQ0sdLlOCraSJOvBRS+BSy9kqQYqjxN+1EcmZg167vj5AuBVGCPcbFQ564GuHMeZdryOYu8K4Fm+QIDerIvXarTBobsJ6O9c7XzUqjX80muDWw56L3RJK19MhjbyDDrip6ZCL1IA4UsDk5fMIreZrs0+MYOrqlI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1733770601; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; bh=RP+RJMd3ZtnBxFIpa2C1GgSta2qA552hwg7OkTPrM7M=; b=VyH0pYocNjSUNPgcx7XMBTuiHBAL6FkyuZ13qc7m1+t4/DL5fgw+TGWlWhnLvXTysKfjSxrJYpkCJZVkd7a+mT1GyB1sM2qTeCoHqM6e7NTEqglU4ntXpLPhBpNY83g709UTPR7DvAfX5+lDm9Yu7qaatuhungnhPMBzb0AJCdw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=collabora.com; spf=pass smtp.mailfrom=usama.anjum@collabora.com; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1733770601; s=zohomail; d=collabora.com; i=usama.anjum@collabora.com; h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-Id:Message-Id:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Reply-To; bh=RP+RJMd3ZtnBxFIpa2C1GgSta2qA552hwg7OkTPrM7M=; b=jU/hGAvyJw7K4UuMi0PGCYaLQ+l0fjDgYZBaWrtSIITwIbuxJhjJi6IxRtZjyTdq Mzs3ojJ3fpUmWNUmhTo6Vq00fAB7nZrW+wSYfP1/VnqBWFsdR/QPZaM4eo6aHB2hPAG HbkC2jp24YrGzCI+ESxIRt27Em++BUkMKgj9Qq8E= Received: by mx.zohomail.com with SMTPS id 1733770599930283.09919285178967; Mon, 9 Dec 2024 10:56:39 -0800 (PST) From: Muhammad Usama Anjum To: Andrew Morton , Shuah Khan , Ryan Roberts , David Hildenbrand , linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Muhammad Usama Anjum , kernel@collabora.com Subject: [PATCH 4/4] selftests/mm: mremap_test: Remove unused variable and type mismatches Date: Mon, 9 Dec 2024 23:56:24 +0500 Message-Id: <20241209185624.2245158-5-usama.anjum@collabora.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241209185624.2245158-1-usama.anjum@collabora.com> References: <20241209185624.2245158-1-usama.anjum@collabora.com> MIME-Version: 1.0 X-ZohoMailClient: External X-Rspamd-Queue-Id: 699F918000D X-Rspam-User: X-Rspamd-Server: rspam07 X-Stat-Signature: hx4wnrrgwxr77jtkc4cu7gy66s9jrntd X-HE-Tag: 1733770596-776842 X-HE-Meta: U2FsdGVkX18UaCHG6/KSYdm+rErkAMG300n0g2CZSWYhhMuMdMTTw6IA8DnhmDJ67y6LeOkSc4QDrLjTkn1JBVJGArDCPs5M9v5GuzW95wOW+vArs6mQBn6OiH8RdO7GQOUG/K3wdGZ2f6H/HRStbeUscBLaLtqx1OUAdEPjrQCSZnrHfcz4wWIgwyyaTq8V3D/TBpCQCvHbFjxzWWcEqkOyXMrOcnCev1vmnsUPNKrnXv8UZ6RAajiwADe/LjHBAfZxuNXotX+7VnQ5sFwOlKRNfXRDrxsIaqCip+3LFc2PGeeW4oM/Af1W4NfO5FwF7BkrTz2Kx0+LIdZoXjmmRgumyfc3gDoh4/PmnaLRDkFVCoMlFix6hZ5x5RzWSCYCCb9jUwXbvsw0KY522RIzJMMXCklrAo4OzqPgvX817ih1OoQsDOuJK3mD4kTKj7DonZKbEg7wAoBZpgc9X4oCgT7/vObWg1NqfzBKzujHjwf59lJAsHkjmewNMMf2LWQT8jMuCqzeX4rjh0ZAlAY2ZUBJ9X8iUs/D2WWG0HU9zo3CX7NSgX68CAEBecLA0gJ/fSkgy8XLJApEEneRro2tjRSF3xuN9Tw1c3Xr8E26MNfqhuRgn8lmrbwcG8HNKuPcvfhLUtOvK+WkCWCWnZXmkdodzqFYs7IPrziIArezaJ4zFQ2L7NjP5B1JgqvWzlCnJyVxerZJ9YfiRvPmsl/ZHBtlPITJOadZYTvmj0io/c7vkdEQJbjFF6WRhV9DQnVuxU0plaXZFVdiqWTJWNHJTE49hVdtHF+sAsYleUqKHqtfxhgaIaqDW+D7k69wqghiM53hY9oj7Dr7DoWXDYyAPbygeZ1BYfPxVehMttns/ZtT4AXRkl46URKYez+Ye5yZYv7bDxUSb1O7R8HrOGSPm+sGkiL8Q059L/VhT5Zd1YhFC5aMS6Vlp+QDTo7T2F8mqopBkhwt3vyE5ByWdam wo+MjjRh xXiVWC5TJUPjYSYKfypH5QmrpCYYrdWb0HhJnuDwQWxZxfOPnXeSHENb1mm2mZTxsHzmiXnEtG/ib2pJnMINSTMORPxg4NDQ7CEyjwOLQIGp657z/AXigYC3sYE0M84hEShqpdJYSvJhww7DCIHbDVEHEdWSjxurg7kfco5OTLK6udTz+hyZMcA0e1N1wp3fb7XPunSKdHh+inyzJVXtIn+1urBi8tHrFftyc2OttN/s1TVZhAWkddSM3XM6DQbAgQCQjwwX9RbR+3UQ9lyOj0DlfO4ef6mSp1GzPwl1N/GJF1Gc52NiAofIKP0h5kMm0WjhcLwBO38h3q2BExCcD1PmzJRVPcjBThXMD6yb2f8iL1dKps2RjpdTTcg== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Remove unused variable and fix type mismatches. Signed-off-by: Muhammad Usama Anjum --- tools/testing/selftests/mm/mremap_test.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/tools/testing/selftests/mm/mremap_test.c b/tools/testing/selftests/mm/mremap_test.c index 5a3a9bcba6404..d207a52f2b5be 100644 --- a/tools/testing/selftests/mm/mremap_test.c +++ b/tools/testing/selftests/mm/mremap_test.c @@ -34,7 +34,7 @@ struct config { unsigned long long dest_alignment; unsigned long long region_size; int overlapping; - int dest_preamble_size; + unsigned int dest_preamble_size; }; struct test { @@ -328,7 +328,7 @@ static void mremap_move_within_range(unsigned int pattern_seed, char *rand_addr) { char *test_name = "mremap mremap move within range"; void *src, *dest; - int i, success = 1; + unsigned int i, success = 1; size_t size = SIZE_MB(20); void *ptr = mmap(NULL, size, PROT_READ | PROT_WRITE, @@ -569,7 +569,7 @@ static void mremap_move_1mb_from_start(unsigned int pattern_seed, { char *test_name = "mremap move 1mb from start at 1MB+256KB aligned src"; void *src = NULL, *dest = NULL; - int i, success = 1; + unsigned int i, success = 1; /* Config to reuse get_source_mapping() to do an aligned mmap. */ struct config c = { @@ -636,7 +636,7 @@ static void mremap_move_1mb_from_start(unsigned int pattern_seed, static void run_mremap_test_case(struct test test_case, int *failures, unsigned int threshold_mb, - unsigned int pattern_seed, char *rand_addr) + char *rand_addr) { long long remap_time = remap_region(test_case.config, threshold_mb, rand_addr); @@ -708,7 +708,8 @@ static int parse_args(int argc, char **argv, unsigned int *threshold_mb, int main(int argc, char **argv) { int failures = 0; - int i, run_perf_tests; + unsigned int i; + int run_perf_tests; unsigned int threshold_mb = VALIDATION_DEFAULT_THRESHOLD; /* hard-coded test configs */ @@ -831,7 +832,7 @@ int main(int argc, char **argv) for (i = 0; i < ARRAY_SIZE(test_cases); i++) run_mremap_test_case(test_cases[i], &failures, threshold_mb, - pattern_seed, rand_addr); + rand_addr); maps_fp = fopen("/proc/self/maps", "r"); @@ -853,7 +854,7 @@ int main(int argc, char **argv) "mremap HAVE_MOVE_PMD/PUD optimization time comparison for 1GB region:"); for (i = 0; i < ARRAY_SIZE(perf_test_cases); i++) run_mremap_test_case(perf_test_cases[i], &failures, - threshold_mb, pattern_seed, + threshold_mb, rand_addr); }