From patchwork Mon Dec 9 18:56:21 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: 13900229 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 4C077E7717D for ; Mon, 9 Dec 2024 18:56:46 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CEE748D00A0; Mon, 9 Dec 2024 13:56:45 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id C9EE08D0058; Mon, 9 Dec 2024 13:56:45 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B67A38D00A0; Mon, 9 Dec 2024 13:56:45 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 95E428D0058 for ; Mon, 9 Dec 2024 13:56:45 -0500 (EST) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 42AA1C09CB for ; Mon, 9 Dec 2024 18:56:45 +0000 (UTC) X-FDA: 82876326540.24.5814E94 Received: from sender4-pp-f112.zoho.com (sender4-pp-f112.zoho.com [136.143.188.112]) by imf18.hostedemail.com (Postfix) with ESMTP id CDAD01C0012 for ; Mon, 9 Dec 2024 18:56:33 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=collabora.com header.s=zohomail header.b=hsozfRMz; dmarc=pass (policy=none) header.from=collabora.com; arc=pass ("zohomail.com:s=zohoarc:i=1"); spf=pass (imf18.hostedemail.com: domain of usama.anjum@collabora.com designates 136.143.188.112 as permitted sender) smtp.mailfrom=usama.anjum@collabora.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1733770583; a=rsa-sha256; cv=pass; b=VaYSL2abOP/4FZHL7fhQgq/ivxr1niOKEEmcH8dlOi/ND4nDHQG+O92K8U28nhs5VMM43a evd3hvIGjckl1xnOhDLbNAIdaen55CB6XsSKeZTJcqv4OiCZS7BJZiSufR+l0Za5Y116Yc SNKb7m7YHa7rPesZxQ6xqbMb/9E45aI= ARC-Authentication-Results: i=2; imf18.hostedemail.com; dkim=pass header.d=collabora.com header.s=zohomail header.b=hsozfRMz; dmarc=pass (policy=none) header.from=collabora.com; arc=pass ("zohomail.com:s=zohoarc:i=1"); spf=pass (imf18.hostedemail.com: domain of usama.anjum@collabora.com designates 136.143.188.112 as permitted sender) smtp.mailfrom=usama.anjum@collabora.com ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1733770583; 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=/Qv2og47kVG8c0xQF+Q2piw26jz1RE6nH/VURIZHB9U=; b=TdByzrhO3jtj9HZzkYdj5K/ruX6mb/jCnNwYmeu32z131iMXCccDuodsc4dLjI7JjTpOV0 eTvTV9n02XFoHwu1FVw2WiLTeUKBhPQGcx2XEO/uY//LvT1JxS1TuO9oxTooGAnotc+RAY RP9Jz+yUMBH6IhOzkrudO+hHVoBjrGw= ARC-Seal: i=1; a=rsa-sha256; t=1733770588; cv=none; d=zohomail.com; s=zohoarc; b=BH1uN4PNbgO2EdoTYC+DWceD5kkupIwlLyYjeNybiRzMbJg2dwWY6374yn17xPx93VfOsxP00ItYIP1SdZ8A+1sdDdTEANNmPet8Wo+NKdsGydgrM33DsxIJ+JUaOd8459RYu410iWq6HMo/C/RgMSYScTTKsOJDqXrQd7KnAY8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1733770588; 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=/Qv2og47kVG8c0xQF+Q2piw26jz1RE6nH/VURIZHB9U=; b=m24NXzuNBxWQASS9nQIl3zB7p9+GMrbdq1V7xQ7pwHvUPjeDS1O11ek18V59J0yvI5rvlzGF4JC/cg0EmWpkp1vg3exK121D74UNnYGPqERqG0J/JpGDc8P4S0wYSg19/+wWXZw+5t17d+3E1x3w2geEw+FjJBeDLQqGmdkik9I= 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=1733770588; 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=/Qv2og47kVG8c0xQF+Q2piw26jz1RE6nH/VURIZHB9U=; b=hsozfRMzsNmgww3EpXvmZ74cjdAxxuzkEY6jVQsUKmRRU2FUgwEiRsOYFr4ccrAZ c4FNYl/MZapxI+zHlQOCc6Cn/Pf5YKglvOZ55epMNdTOaweM0lZsuDwxWpD5Q2rIIaf KMHT8RcgD9od9TQRHSqFFre14sSIrtDMzuyjwgfU= Received: by mx.zohomail.com with SMTPS id 1733770586925426.83591125268447; Mon, 9 Dec 2024 10:56:26 -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 1/4] selftests/mm: thp_settings: remove const from return type Date: Mon, 9 Dec 2024 23:56:21 +0500 Message-Id: <20241209185624.2245158-2-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-Stat-Signature: 4uecfcxw7ucbxkfmzwigw1nef3pd4naf X-Rspam-User: X-Rspamd-Queue-Id: CDAD01C0012 X-Rspamd-Server: rspam08 X-HE-Tag: 1733770593-156081 X-HE-Meta: U2FsdGVkX1/AvUcT7k0SGqLcyBlpXx8QECUcxRb7yRHIspBEPmA8jIF1s0+P7AKjrqUi5ciLbH1n02e/7U+Q2YO/kAeyw/gT/Ba2fkObk7OPnQwJRhDt5LhBQNLCiA6SSeW70HzyM7M18xhG+OQ6KNZnOMHy+xYet0Fi0L1HTRwwSgtUq1uBLeez9oJ6hW0cxDElLLiFjw72r+5wuglUgCxBa692g8hdrRDi6BQTH/Edtxx/Kh1dIIukGexXDdp/7m+jwEjyYwiM8OypY4LpJrdTbt4oqpJc8bykTFWka5Q2YgrT5r4NDGOnpBivZPM0hxb4GZiknffG/K2wFL3udRUz6n9yTDnoCcThGGJf5dbNBy4guPDxF8c53eDsCAgaEOJGu+04lmBbQ88XP96ZPE+ktHBemFyTJJZE27dUvVuvNAcw92R4TqLtvUK8j/oGeaECcFmGNXLVfRg1zcj8XInP4/JRIg0TxCTnH3nLgTgccLJBprX2QlIql/ZykRsLEuHe4Ioyfy7OmgRQvv+vieqZmkyZ2Ovj+00IVkEVmFuXulyYC5uf1Lbw0KyR55DyEpwJpUd2Abxhjn3NpDPsx8YulzZB9zvZhn183eQ0rhJxWJDafR/NgOFaZy64uFouYio9le925T3Vs1G1i3wVVR9qqHW5LFO5ot1EnIlYYK5tse7Mpi4hlBCLpcA07aF583QsW7D5Z8ASO6l1xwi6VRrgEg8ObGrVen/YD6vYAe4Eq+5dyDBqUu5gjRJ3LqMmCM5uDJ+Ltnrt4IF6+E9JFtyEwRQ7Im/VkjwIdeupMnnf/X11Kd1MzJ93pMQbZxgwrVlNiZXia5d22Vdshfp9r+OuCo+1y1V4ZebN5P9P5ZgoaEuhj07g7JIHjyF3tLsiVmKOST5Km4GW8p9Xo/sBz7MEYtCST/4VpSi3cxjHJAOW5rmUmzdBQy5XxqghHVjf0j7rz839cW6h4/7nqWE VI6U7Rp+ 6cMVnKG9XqJHFPDrd0iqVShCfZmAgY78cWjxn6/FCRxSAfO4dFiaGdyVndNRg/EFEdCfgfa8MkYka7jHwwNJHiBdi0IIurT2JYEHnBoi8bzuwN78N4pBBRFRTCbeUxncBrfA235IKV03M0UuvN3uGiyPXneni0PD2jlKil6TbNHz27XhkLHjdjUcnVp1chyymPy3suAM2LrUyQHnNxgoAG5b0GHhLOXD9KC5NR8WxascHhnsgtYds0A0SQE0pDXKjS9igXK+/Xh7FySeiV41gGUiuoAOGnIFTmF/JosE+tL2OGJmJAkCT1pLNcTzmW1noPG6WojbrsFADsCYtFqdwYzESI1362N6PAhK0X2ft+9zoswJaADsEQOGmug== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000281, 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 cost from the return type as it is ignored anyways and generates the warning: warning: type qualifiers ignored on function return type [-Wignored-qualifiers] Signed-off-by: Muhammad Usama Anjum --- Optional fixes tag. Fixes: 00679a183ac6 ("selftests/mm: factor out thp settings management") Add fixes tag to last patch which had created these files instead of original patch which added these. --- tools/testing/selftests/mm/thp_settings.c | 4 ++-- tools/testing/selftests/mm/thp_settings.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/testing/selftests/mm/thp_settings.c b/tools/testing/selftests/mm/thp_settings.c index 577eaab6266fd..ad872af1c81aa 100644 --- a/tools/testing/selftests/mm/thp_settings.c +++ b/tools/testing/selftests/mm/thp_settings.c @@ -87,7 +87,7 @@ int write_file(const char *path, const char *buf, size_t buflen) return (unsigned int) numwritten; } -const unsigned long read_num(const char *path) +unsigned long read_num(const char *path) { char buf[21]; @@ -172,7 +172,7 @@ void thp_write_string(const char *name, const char *val) } } -const unsigned long thp_read_num(const char *name) +unsigned long thp_read_num(const char *name) { char path[PATH_MAX]; int ret; diff --git a/tools/testing/selftests/mm/thp_settings.h b/tools/testing/selftests/mm/thp_settings.h index 876235a23460c..fc131d23d5930 100644 --- a/tools/testing/selftests/mm/thp_settings.h +++ b/tools/testing/selftests/mm/thp_settings.h @@ -64,12 +64,12 @@ struct thp_settings { int read_file(const char *path, char *buf, size_t buflen); int write_file(const char *path, const char *buf, size_t buflen); -const unsigned long read_num(const char *path); +unsigned long read_num(const char *path); void write_num(const char *path, unsigned long num); int thp_read_string(const char *name, const char * const strings[]); void thp_write_string(const char *name, const char *val); -const unsigned long thp_read_num(const char *name); +unsigned long thp_read_num(const char *name); void thp_write_num(const char *name, unsigned long num); void thp_write_settings(struct thp_settings *settings); From patchwork Mon Dec 9 18:56:22 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: 13900230 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 0EC73E7717D for ; Mon, 9 Dec 2024 18:56:52 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 993898D00A1; Mon, 9 Dec 2024 13:56:51 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 9440B8D0058; Mon, 9 Dec 2024 13:56:51 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7BF098D00A1; Mon, 9 Dec 2024 13:56:51 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 510C08D0058 for ; Mon, 9 Dec 2024 13:56:51 -0500 (EST) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 0AD2E1A0982 for ; Mon, 9 Dec 2024 18:56:51 +0000 (UTC) X-FDA: 82876326162.09.F5159D5 Received: from sender4-pp-f112.zoho.com (sender4-pp-f112.zoho.com [136.143.188.112]) by imf17.hostedemail.com (Postfix) with ESMTP id 1DAC140004 for ; Mon, 9 Dec 2024 18:56:32 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=collabora.com header.s=zohomail header.b=U9e8g75w; arc=pass ("zohomail.com:s=zohoarc:i=1"); spf=pass (imf17.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=1733770595; 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=Aa6Ev6AdlAGuu46ziJ8I8hrGYJJJOdRZ2Ry7xCMJsog=; b=TvCugjsW9EDTicjW4ZSj1tzrJlnrwIkLDmgDzR9PJEnkDrwxaGFialPy2AZwV1tfLGY6Vj eoY3YS9i9KzDnTmZZronO0hYfJZipO5UuBbNk8x7jRmpS/Yy2agBFwVlT4PBqtQAEmnCrH 1nLF+RcuBt0ILuR6FgJWjA0oycDyXRQ= ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1733770595; a=rsa-sha256; cv=pass; b=paamh8q4J4Su6+1ya+yc68CceSZpbYAJ/FmhPu31VDKwQdxnouJINo1IGxU/hFvDYOHRh2 woLt9tcHEELlggrzVCuTR6sGsJI+UN39OB3kyoCZ8vUhwxqsy/Gk1SPP+xHcB3ruVDxGUV p5WMEaRVFxv4ByU6YO4FoqI2dhXjoaE= ARC-Authentication-Results: i=2; imf17.hostedemail.com; dkim=pass header.d=collabora.com header.s=zohomail header.b=U9e8g75w; arc=pass ("zohomail.com:s=zohoarc:i=1"); spf=pass (imf17.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=1733770592; cv=none; d=zohomail.com; s=zohoarc; b=MwLLJKsuXlpyt6yX0IIG/ksXCghviOr07JiPcVodaCffEbGUPMpOO7XqSYvsa7Th7LgCBCbl46pi7Cg+yK5e8UQid68DlGt8KJgf2tSMZooHbGXHlQ4rhdqB2oRe8PA8ZGeEndSSfS1QrmnmGLlctvqxZzxVQYhWGXc0ffcPo5g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1733770592; 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=Aa6Ev6AdlAGuu46ziJ8I8hrGYJJJOdRZ2Ry7xCMJsog=; b=TM9NXJ3sua27JA6aLDs/FZQ4Gw82kWePmchroak8WTABfH0UfDZNv+NkL6XWP3xTtBBpjh+I0HZjK9lsGu4XgFo1g3uKgYXKZsKszKHvJg++aMotp/UsDb+NMwbYp3aPy1zNJCpQYywhHTYWyO3hp5sWBwdnp6y8zjhUzF2+SSA= 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=1733770592; 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=Aa6Ev6AdlAGuu46ziJ8I8hrGYJJJOdRZ2Ry7xCMJsog=; b=U9e8g75w1h6jOjgRb7Ii4MnYLxZP9E0p7TaDAi6JlxJZvK5TCebgI4PfC4lLqRLu 0MaeUlLOPVKSoXIqYByaCxHV4vSd6tUBZAKwLTgiirKkYDcEYVIJstvPE+sSETC6e/2 I6Ox6K/ahu9Vhr4B29DTHaPZo9IoToEqpea/ojlw= Received: by mx.zohomail.com with SMTPS id 1733770591245682.5886911099266; Mon, 9 Dec 2024 10:56:31 -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 2/4] selftests/mm: pagemap_ioctl: Fix types mismatches shown by compiler options Date: Mon, 9 Dec 2024 23:56:22 +0500 Message-Id: <20241209185624.2245158-3-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-Server: rspam02 X-Rspamd-Queue-Id: 1DAC140004 X-Stat-Signature: k7io66chfqr3sbnc33jw7g5t4dskiacy X-Rspam-User: X-HE-Tag: 1733770592-125415 X-HE-Meta: U2FsdGVkX1/3N3rSze4Q2K9svqqSCb0Af9AsHWQ6ZIDRX56U3JDRUjXOT5iOYiTZklyoZ8lg85Rg0LS7zf6P9bjy5BsRCnVEzPxDC7mckrymV0epV38mE8plwCeTBxZ+1l86I5qblLNAm/k4j1L7T2PLWwEX3c0KBwI9HoRYGyHBzGEIUqW6pTOLz9vuLYoOFz/D+wWWzYBf1GY6OZGNU4x2haESyPK+XLr0bGTlx/x9EOit1mojl/rdwJEvvrizpKZZC/ZS++t7LcwUiA/8s51lG5dTfxo/XGeUpc+H37pNG3GVZFQLCidO6LZQ7KZONYuz08H6zi8a5HuuINVX3KxburdZQkawehRXncWt0a/ltn/RVCYpD7wpoG0FVjxvwdAWmOO6MOU4vHNWikWSQIT4UpMLlaNlqBggps4JhDzRm4pPeVbyfHpy5aCplQaBWfFXLi3qf8fcivTHiyFQqjphEktpuhUwm/v/9otAeyjDZD5o0TlWUZJi/pV/aeDM0taoEQX3Z7IzVVV1IJmIAgUmyXFJ0XzU0idKmAP7HqSnEn4io1WH4XeWwIDFLTxgKobf+zHZv9l1BFTqIZMqXcpDfh4kK3gCZ49b8vOdBJ4/Th1vRghjGCs1zBn68WERSICGq0hbcyrU38CywidlBn0koUiWR/OtFELIWLaMrEi+GYB9F0l5iqCue03rOjNaIJx2Yq/j0wkylKgJXs/mC/Ixy/LLs5EPw9Q+OBoYT0FzUJycNAXivbc9bKXwBTfB7YCIh3DXuxgh+T0lkdXgfrA1lwW/lI7RN9pe2uCGbf6VptD7jHBieIndHOzFuWnbANw6kZsSVp8yaHxX6j2SAhL0YGjSixwjhd6UuwFboKwE/4yHvyxaU8G8CvL7wnnoBLSKxthQZ/0nxQPV3xeB+FyGbTgRThLm83NCvEZOHCZZihw7LmFayYi+tDaBcvgn4iZpFH9KyG5kIS3lPHE o/Jd/nYG pgHxyseJ5lGA72recXhpU66xoC11U60msnaivmcbBehBYrMb43uvbCfstuWxA2Eh7yP225eo37v5cvVrCF+x+LhHRF/FAgYQdI/35+dVHkoiaYaO5ezRvc1efB9UKlNX8ZAXsGk9IaFj1Lzbl2vheIJTHPVZrl3lzTLG1h9e/w7V89hIJwIcO7BYs5QXLaw+7uN3cxB9zmoEPih3Hn5wACpUXHMVJh1pEg/2woW1S3Kv95GLvJrKLBZqnzfHwAOmi8JZ0tMzO40uvl1pn13i5lf6xuHuLpHRK1DxkBHcxXJErmqlyK4muYp40PQlekIYAmSmj0+/TFQz3/j8WiAtk37gPPe6P/xUOAUpA+OWP53Xu6QY8pO9lht9iYw== 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: Fix following warnings caught by compiler: - There are several type mismatches among different variables. - Remove unused variable warnings. Signed-off-by: Muhammad Usama Anjum --- tools/testing/selftests/mm/pagemap_ioctl.c | 108 +++++++++++---------- tools/testing/selftests/mm/vm_util.c | 2 +- 2 files changed, 59 insertions(+), 51 deletions(-) diff --git a/tools/testing/selftests/mm/pagemap_ioctl.c b/tools/testing/selftests/mm/pagemap_ioctl.c index fdafce0654e90..57b4bba2b45f3 100644 --- a/tools/testing/selftests/mm/pagemap_ioctl.c +++ b/tools/testing/selftests/mm/pagemap_ioctl.c @@ -34,8 +34,8 @@ #define PAGEMAP "/proc/self/pagemap" int pagemap_fd; int uffd; -int page_size; -int hpage_size; +unsigned int page_size; +unsigned int hpage_size; const char *progname; #define LEN(region) ((region.end - region.start)/page_size) @@ -235,7 +235,9 @@ int get_reads(struct page_region *vec, int vec_size) int sanity_tests_sd(void) { - int mem_size, vec_size, ret, ret2, ret3, i, num_pages = 1000, total_pages = 0; + unsigned long long mem_size, vec_size, i, total_pages = 0; + long ret, ret2, ret3; + int num_pages = 1000; int total_writes, total_reads, reads, count; struct page_region *vec, *vec2; char *mem, *m[2]; @@ -321,9 +323,9 @@ int sanity_tests_sd(void) ret = pagemap_ioctl(mem, mem_size, vec, vec_size, 0, 0, PAGE_IS_WRITTEN, 0, 0, PAGE_IS_WRITTEN); if (ret < 0) - ksft_exit_fail_msg("error %d %d %s\n", ret, errno, strerror(errno)); + ksft_exit_fail_msg("error %ld %d %s\n", ret, errno, strerror(errno)); - ksft_test_result(ret == mem_size/(page_size * 2), + ksft_test_result((unsigned long long)ret == mem_size/(page_size * 2), "%s Repeated pattern of written and non-written pages\n", __func__); /* 4. Repeated pattern of written and non-written pages in parts */ @@ -331,21 +333,21 @@ int sanity_tests_sd(void) PM_SCAN_WP_MATCHING | PM_SCAN_CHECK_WPASYNC, num_pages/2 - 2, PAGE_IS_WRITTEN, 0, 0, PAGE_IS_WRITTEN); if (ret < 0) - ksft_exit_fail_msg("error %d %d %s\n", ret, errno, strerror(errno)); + ksft_exit_fail_msg("error %ld %d %s\n", ret, errno, strerror(errno)); ret2 = pagemap_ioctl(mem, mem_size, vec, 2, 0, 0, PAGE_IS_WRITTEN, 0, 0, PAGE_IS_WRITTEN); if (ret2 < 0) - ksft_exit_fail_msg("error %d %d %s\n", ret2, errno, strerror(errno)); + ksft_exit_fail_msg("error %ld %d %s\n", ret2, errno, strerror(errno)); ret3 = pagemap_ioctl(mem, mem_size, vec, vec_size, PM_SCAN_WP_MATCHING | PM_SCAN_CHECK_WPASYNC, 0, PAGE_IS_WRITTEN, 0, 0, PAGE_IS_WRITTEN); if (ret3 < 0) - ksft_exit_fail_msg("error %d %d %s\n", ret3, errno, strerror(errno)); + ksft_exit_fail_msg("error %ld %d %s\n", ret3, errno, strerror(errno)); ksft_test_result((ret + ret3) == num_pages/2 && ret2 == 2, - "%s Repeated pattern of written and non-written pages in parts %d %d %d\n", + "%s Repeated pattern of written and non-written pages in parts %ld %ld %ld\n", __func__, ret, ret3, ret2); /* 5. Repeated pattern of written and non-written pages max_pages */ @@ -357,13 +359,13 @@ int sanity_tests_sd(void) PM_SCAN_WP_MATCHING | PM_SCAN_CHECK_WPASYNC, num_pages/2, PAGE_IS_WRITTEN, 0, 0, PAGE_IS_WRITTEN); if (ret < 0) - ksft_exit_fail_msg("error %d %d %s\n", ret, errno, strerror(errno)); + ksft_exit_fail_msg("error %ld %d %s\n", ret, errno, strerror(errno)); ret2 = pagemap_ioctl(mem, mem_size, vec, vec_size, PM_SCAN_WP_MATCHING | PM_SCAN_CHECK_WPASYNC, 0, PAGE_IS_WRITTEN, 0, 0, PAGE_IS_WRITTEN); if (ret2 < 0) - ksft_exit_fail_msg("error %d %d %s\n", ret2, errno, strerror(errno)); + ksft_exit_fail_msg("error %ld %d %s\n", ret2, errno, strerror(errno)); ksft_test_result(ret == num_pages/2 && ret2 == 1, "%s Repeated pattern of written and non-written pages max_pages\n", @@ -378,12 +380,12 @@ int sanity_tests_sd(void) PM_SCAN_WP_MATCHING | PM_SCAN_CHECK_WPASYNC, 2, PAGE_IS_WRITTEN, 0, 0, PAGE_IS_WRITTEN); if (ret < 0) - ksft_exit_fail_msg("error %d %d %s\n", ret, errno, strerror(errno)); + ksft_exit_fail_msg("error %ld %d %s\n", ret, errno, strerror(errno)); ret2 = pagemap_ioctl(mem, mem_size, vec2, vec_size, 0, 0, PAGE_IS_WRITTEN, 0, 0, PAGE_IS_WRITTEN); if (ret2 < 0) - ksft_exit_fail_msg("error %d %d %s\n", ret2, errno, strerror(errno)); + ksft_exit_fail_msg("error %ld %d %s\n", ret2, errno, strerror(errno)); ksft_test_result(ret == 1 && LEN(vec[0]) == 2 && vec[0].start == (uintptr_t)(mem + page_size) && @@ -416,7 +418,7 @@ int sanity_tests_sd(void) ret = pagemap_ioctl(m[1], mem_size, vec, 1, 0, 0, PAGE_IS_WRITTEN, 0, 0, PAGE_IS_WRITTEN); if (ret < 0) - ksft_exit_fail_msg("error %d %d %s\n", ret, errno, strerror(errno)); + ksft_exit_fail_msg("error %ld %d %s\n", ret, errno, strerror(errno)); ksft_test_result(ret == 1 && LEN(vec[0]) == mem_size/page_size, "%s Two regions\n", __func__); @@ -448,7 +450,7 @@ int sanity_tests_sd(void) PM_SCAN_WP_MATCHING | PM_SCAN_CHECK_WPASYNC, 0, PAGE_IS_WRITTEN, 0, 0, PAGE_IS_WRITTEN); if (ret < 0) - ksft_exit_fail_msg("error %d %d %s\n", ret, errno, strerror(errno)); + ksft_exit_fail_msg("error %ld %d %s\n", ret, errno, strerror(errno)); for (i = 0; i < mem_size/page_size; i += 2) mem[i * page_size]++; @@ -457,7 +459,7 @@ int sanity_tests_sd(void) PM_SCAN_WP_MATCHING | PM_SCAN_CHECK_WPASYNC, mem_size/(page_size*5), PAGE_IS_WRITTEN, 0, 0, PAGE_IS_WRITTEN); if (ret < 0) - ksft_exit_fail_msg("error %d %d %s\n", ret, errno, strerror(errno)); + ksft_exit_fail_msg("error %ld %d %s\n", ret, errno, strerror(errno)); total_pages += ret; @@ -465,7 +467,7 @@ int sanity_tests_sd(void) PM_SCAN_WP_MATCHING | PM_SCAN_CHECK_WPASYNC, mem_size/(page_size*5), PAGE_IS_WRITTEN, 0, 0, PAGE_IS_WRITTEN); if (ret < 0) - ksft_exit_fail_msg("error %d %d %s\n", ret, errno, strerror(errno)); + ksft_exit_fail_msg("error %ld %d %s\n", ret, errno, strerror(errno)); total_pages += ret; @@ -473,7 +475,7 @@ int sanity_tests_sd(void) PM_SCAN_WP_MATCHING | PM_SCAN_CHECK_WPASYNC, mem_size/(page_size*5), PAGE_IS_WRITTEN, 0, 0, PAGE_IS_WRITTEN); if (ret < 0) - ksft_exit_fail_msg("error %d %d %s\n", ret, errno, strerror(errno)); + ksft_exit_fail_msg("error %ld %d %s\n", ret, errno, strerror(errno)); total_pages += ret; @@ -515,9 +517,9 @@ int sanity_tests_sd(void) vec_size, PM_SCAN_WP_MATCHING | PM_SCAN_CHECK_WPASYNC, 0, PAGE_IS_WRITTEN, 0, 0, PAGE_IS_WRITTEN, &walk_end); if (ret < 0) - ksft_exit_fail_msg("error %d %d %s\n", ret, errno, strerror(errno)); + ksft_exit_fail_msg("error %ld %d %s\n", ret, errno, strerror(errno)); - if (ret > vec_size) + if ((unsigned long)ret > vec_size) break; reads = get_reads(vec, ret); @@ -554,63 +556,63 @@ int sanity_tests_sd(void) ret = pagemap_ioc(mem, 0, vec, vec_size, 0, 0, PAGE_IS_WRITTEN, 0, 0, PAGE_IS_WRITTEN, &walk_end); if (ret < 0) - ksft_exit_fail_msg("error %d %d %s\n", ret, errno, strerror(errno)); + ksft_exit_fail_msg("error %ld %d %s\n", ret, errno, strerror(errno)); ksft_test_result(ret == 0 && walk_end == (long)mem, "Walk_end: Same start and end address\n"); ret = pagemap_ioc(mem, 0, vec, vec_size, PM_SCAN_WP_MATCHING | PM_SCAN_CHECK_WPASYNC, 0, PAGE_IS_WRITTEN, 0, 0, PAGE_IS_WRITTEN, &walk_end); if (ret < 0) - ksft_exit_fail_msg("error %d %d %s\n", ret, errno, strerror(errno)); + ksft_exit_fail_msg("error %ld %d %s\n", ret, errno, strerror(errno)); ksft_test_result(ret == 0 && walk_end == (long)mem, "Walk_end: Same start and end with WP\n"); ret = pagemap_ioc(mem, 0, vec, 0, PM_SCAN_WP_MATCHING | PM_SCAN_CHECK_WPASYNC, 0, PAGE_IS_WRITTEN, 0, 0, PAGE_IS_WRITTEN, &walk_end); if (ret < 0) - ksft_exit_fail_msg("error %d %d %s\n", ret, errno, strerror(errno)); + ksft_exit_fail_msg("error %ld %d %s\n", ret, errno, strerror(errno)); ksft_test_result(ret == 0 && walk_end == (long)mem, "Walk_end: Same start and end with 0 output buffer\n"); ret = pagemap_ioc(mem, mem_size, vec, vec_size, 0, 0, PAGE_IS_WRITTEN, 0, 0, PAGE_IS_WRITTEN, &walk_end); if (ret < 0) - ksft_exit_fail_msg("error %d %d %s\n", ret, errno, strerror(errno)); + ksft_exit_fail_msg("error %ld %d %s\n", ret, errno, strerror(errno)); ksft_test_result(ret == 1 && walk_end == (long)(mem + mem_size), "Walk_end: Big vec\n"); ret = pagemap_ioc(mem, mem_size, vec, 1, 0, 0, PAGE_IS_WRITTEN, 0, 0, PAGE_IS_WRITTEN, &walk_end); if (ret < 0) - ksft_exit_fail_msg("error %d %d %s\n", ret, errno, strerror(errno)); + ksft_exit_fail_msg("error %ld %d %s\n", ret, errno, strerror(errno)); ksft_test_result(ret == 1 && walk_end == (long)(mem + mem_size), "Walk_end: vec of minimum length\n"); ret = pagemap_ioc(mem, mem_size, vec, 1, 0, vec_size, PAGE_IS_WRITTEN, 0, 0, PAGE_IS_WRITTEN, &walk_end); if (ret < 0) - ksft_exit_fail_msg("error %d %d %s\n", ret, errno, strerror(errno)); + ksft_exit_fail_msg("error %ld %d %s\n", ret, errno, strerror(errno)); ksft_test_result(ret == 1 && walk_end == (long)(mem + mem_size), "Walk_end: Max pages specified\n"); ret = pagemap_ioc(mem, mem_size, vec, vec_size, 0, vec_size/2, PAGE_IS_WRITTEN, 0, 0, PAGE_IS_WRITTEN, &walk_end); if (ret < 0) - ksft_exit_fail_msg("error %d %d %s\n", ret, errno, strerror(errno)); + ksft_exit_fail_msg("error %ld %d %s\n", ret, errno, strerror(errno)); ksft_test_result(ret == 1 && walk_end == (long)(mem + mem_size/2), "Walk_end: Half max pages\n"); ret = pagemap_ioc(mem, mem_size, vec, vec_size, 0, 1, PAGE_IS_WRITTEN, 0, 0, PAGE_IS_WRITTEN, &walk_end); if (ret < 0) - ksft_exit_fail_msg("error %d %d %s\n", ret, errno, strerror(errno)); + ksft_exit_fail_msg("error %ld %d %s\n", ret, errno, strerror(errno)); ksft_test_result(ret == 1 && walk_end == (long)(mem + page_size), "Walk_end: 1 max page\n"); ret = pagemap_ioc(mem, mem_size, vec, vec_size, 0, -1, PAGE_IS_WRITTEN, 0, 0, PAGE_IS_WRITTEN, &walk_end); if (ret < 0) - ksft_exit_fail_msg("error %d %d %s\n", ret, errno, strerror(errno)); + ksft_exit_fail_msg("error %ld %d %s\n", ret, errno, strerror(errno)); ksft_test_result(ret == 1 && walk_end == (long)(mem + mem_size), "Walk_end: max pages\n"); @@ -621,49 +623,49 @@ int sanity_tests_sd(void) ret = pagemap_ioc(mem, mem_size, vec, vec_size, 0, 0, PAGE_IS_WRITTEN, 0, 0, PAGE_IS_WRITTEN, &walk_end); if (ret < 0) - ksft_exit_fail_msg("error %d %d %s\n", ret, errno, strerror(errno)); - ksft_test_result(ret == vec_size/2 && walk_end == (long)(mem + mem_size), + ksft_exit_fail_msg("error %ld %d %s\n", ret, errno, strerror(errno)); + ksft_test_result((unsigned long)ret == vec_size/2 && walk_end == (long)(mem + mem_size), "Walk_end sparse: Big vec\n"); ret = pagemap_ioc(mem, mem_size, vec, 1, 0, 0, PAGE_IS_WRITTEN, 0, 0, PAGE_IS_WRITTEN, &walk_end); if (ret < 0) - ksft_exit_fail_msg("error %d %d %s\n", ret, errno, strerror(errno)); + ksft_exit_fail_msg("error %ld %d %s\n", ret, errno, strerror(errno)); ksft_test_result(ret == 1 && walk_end == (long)(mem + page_size * 2), "Walk_end sparse: vec of minimum length\n"); ret = pagemap_ioc(mem, mem_size, vec, 1, 0, vec_size, PAGE_IS_WRITTEN, 0, 0, PAGE_IS_WRITTEN, &walk_end); if (ret < 0) - ksft_exit_fail_msg("error %d %d %s\n", ret, errno, strerror(errno)); + ksft_exit_fail_msg("error %ld %d %s\n", ret, errno, strerror(errno)); ksft_test_result(ret == 1 && walk_end == (long)(mem + page_size * 2), "Walk_end sparse: Max pages specified\n"); ret = pagemap_ioc(mem, mem_size, vec, vec_size/2, 0, vec_size, PAGE_IS_WRITTEN, 0, 0, PAGE_IS_WRITTEN, &walk_end); if (ret < 0) - ksft_exit_fail_msg("error %d %d %s\n", ret, errno, strerror(errno)); - ksft_test_result(ret == vec_size/2 && walk_end == (long)(mem + mem_size), + ksft_exit_fail_msg("error %ld %d %s\n", ret, errno, strerror(errno)); + ksft_test_result((unsigned long)ret == vec_size/2 && walk_end == (long)(mem + mem_size), "Walk_end sparse: Max pages specified\n"); ret = pagemap_ioc(mem, mem_size, vec, vec_size, 0, vec_size, PAGE_IS_WRITTEN, 0, 0, PAGE_IS_WRITTEN, &walk_end); if (ret < 0) - ksft_exit_fail_msg("error %d %d %s\n", ret, errno, strerror(errno)); - ksft_test_result(ret == vec_size/2 && walk_end == (long)(mem + mem_size), + ksft_exit_fail_msg("error %ld %d %s\n", ret, errno, strerror(errno)); + ksft_test_result((unsigned long)ret == vec_size/2 && walk_end == (long)(mem + mem_size), "Walk_end sparse: Max pages specified\n"); ret = pagemap_ioc(mem, mem_size, vec, vec_size, 0, vec_size/2, PAGE_IS_WRITTEN, 0, 0, PAGE_IS_WRITTEN, &walk_end); if (ret < 0) - ksft_exit_fail_msg("error %d %d %s\n", ret, errno, strerror(errno)); - ksft_test_result(ret == vec_size/2 && walk_end == (long)(mem + mem_size), + ksft_exit_fail_msg("error %ld %d %s\n", ret, errno, strerror(errno)); + ksft_test_result((unsigned long)ret == vec_size/2 && walk_end == (long)(mem + mem_size), "Walk_endsparse : Half max pages\n"); ret = pagemap_ioc(mem, mem_size, vec, vec_size, 0, 1, PAGE_IS_WRITTEN, 0, 0, PAGE_IS_WRITTEN, &walk_end); if (ret < 0) - ksft_exit_fail_msg("error %d %d %s\n", ret, errno, strerror(errno)); + ksft_exit_fail_msg("error %ld %d %s\n", ret, errno, strerror(errno)); ksft_test_result(ret == 1 && walk_end == (long)(mem + page_size * 2), "Walk_end: 1 max page\n"); @@ -674,9 +676,10 @@ int sanity_tests_sd(void) return 0; } -int base_tests(char *prefix, char *mem, int mem_size, int skip) +int base_tests(char *prefix, char *mem, unsigned long long mem_size, int skip) { - int vec_size, written; + unsigned long long vec_size; + int written; struct page_region *vec, *vec2; if (skip) { @@ -799,8 +802,8 @@ int hpage_unit_tests(void) char *map; int ret, ret2; size_t num_pages = 10; - int map_size = hpage_size * num_pages; - int vec_size = map_size/page_size; + unsigned long long map_size = hpage_size * num_pages; + unsigned long long vec_size = map_size/page_size; struct page_region *vec, *vec2; vec = malloc(sizeof(struct page_region) * vec_size); @@ -1047,7 +1050,8 @@ static void test_simple(void) int sanity_tests(void) { - int mem_size, vec_size, ret, fd, i, buf_size; + unsigned long long mem_size, vec_size; + int ret, fd, i, buf_size; struct page_region *vec; char *mem, *fmem; struct stat sbuf; @@ -1312,7 +1316,9 @@ static ssize_t get_dirty_pages_reset(char *mem, unsigned int count, { struct pm_scan_arg arg = {0}; struct page_region rgns[256]; - int i, j, cnt, ret; + unsigned long long i, j; + long ret; + int cnt; arg.size = sizeof(struct pm_scan_arg); arg.start = (uintptr_t)mem; @@ -1330,7 +1336,7 @@ static ssize_t get_dirty_pages_reset(char *mem, unsigned int count, ksft_exit_fail_msg("ioctl failed\n"); cnt = 0; - for (i = 0; i < ret; ++i) { + for (i = 0; i < (unsigned long)ret; ++i) { if (rgns[i].categories != PAGE_IS_WRITTEN) ksft_exit_fail_msg("wrong flags\n"); @@ -1384,9 +1390,10 @@ void *thread_proc(void *mem) static void transact_test(int page_size) { unsigned int i, count, extra_pages; + unsigned int c; pthread_t th; char *mem; - int ret, c; + int ret; if (pthread_barrier_init(&start_barrier, NULL, nthreads + 1)) ksft_exit_fail_msg("pthread_barrier_init\n"); @@ -1473,9 +1480,10 @@ static void transact_test(int page_size) extra_thread_faults); } -int main(int argc, char *argv[]) +int main(int __attribute__((unused)) argc, char *argv[]) { - int mem_size, shmid, buf_size, fd, i, ret; + int shmid, buf_size, fd, i, ret; + unsigned long long mem_size; char *mem, *map, *fmem; struct stat sbuf; diff --git a/tools/testing/selftests/mm/vm_util.c b/tools/testing/selftests/mm/vm_util.c index d8d0cf04bb57f..7519c9a892f0f 100644 --- a/tools/testing/selftests/mm/vm_util.c +++ b/tools/testing/selftests/mm/vm_util.c @@ -138,7 +138,7 @@ void clear_softdirty(void) ksft_exit_fail_msg("opening clear_refs failed\n"); ret = write(fd, ctrl, strlen(ctrl)); close(fd); - if (ret != strlen(ctrl)) + if (ret != (signed int)strlen(ctrl)) ksft_exit_fail_msg("writing clear_refs failed\n"); } From patchwork Mon Dec 9 18:56:23 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: 13900231 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 04AD4E77181 for ; Mon, 9 Dec 2024 18:56:54 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 76D2C8D00A2; Mon, 9 Dec 2024 13:56:53 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 6D45D8D0058; Mon, 9 Dec 2024 13:56:53 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 59DC38D00A2; Mon, 9 Dec 2024 13:56:53 -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 2D30A8D0058 for ; Mon, 9 Dec 2024 13:56:53 -0500 (EST) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id E3AB38064B for ; Mon, 9 Dec 2024 18:56:52 +0000 (UTC) X-FDA: 82876325994.20.7086C23 Received: from sender4-pp-f112.zoho.com (sender4-pp-f112.zoho.com [136.143.188.112]) by imf30.hostedemail.com (Postfix) with ESMTP id 1755A80008 for ; Mon, 9 Dec 2024 18:56:10 +0000 (UTC) Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=collabora.com header.s=zohomail header.b=Y90OE4mV; spf=pass (imf30.hostedemail.com: domain of usama.anjum@collabora.com designates 136.143.188.112 as permitted sender) smtp.mailfrom=usama.anjum@collabora.com; arc=pass ("zohomail.com:s=zohoarc:i=1"); 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=1733770601; 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=UCUyWepyHotuSHog4wQxtOXcYGnVWgzvFlwrr2hbZtY=; b=qMhfErYHkirMEzf8QYB3zEDrk9sucYuA/cl1Z9rsh8dmGHb1DqjmYbhPGOsXeXQQG0cWtf F1jVdqdrNORwcgCLeS39brIEi9qbRdvFnXbKGe8yxB1ZQuNMdRaeIkw1Vpj46ZND0Ltlle gsn1IeNilYY5Zr30xmdPHuRQNvUkIB8= ARC-Authentication-Results: i=2; imf30.hostedemail.com; dkim=pass header.d=collabora.com header.s=zohomail header.b=Y90OE4mV; spf=pass (imf30.hostedemail.com: domain of usama.anjum@collabora.com designates 136.143.188.112 as permitted sender) smtp.mailfrom=usama.anjum@collabora.com; arc=pass ("zohomail.com:s=zohoarc:i=1"); dmarc=pass (policy=none) header.from=collabora.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1733770601; a=rsa-sha256; cv=pass; b=nN/8e8um7KZodl5uIgprd9JOMrXQAEwGvSEDZcVuGKP0snl3oVOeea7gGa/3LBbUAqNfdl Tu1cYRFxL/UUtzJAp50X6DR+GALpDwcoqyeBhC6D4f9D31AwVyDSxkDUa2/KPUxsB96ZWc Kn6qZxMFDxaPki1czaoaeHO6vwdgdew= ARC-Seal: i=1; a=rsa-sha256; t=1733770597; cv=none; d=zohomail.com; s=zohoarc; b=RjOhkKQL1I0ZoRri8DBlSn6/WZHwpyl500sYUpzR1zUxcT5VyAu44vbwDPBR/tdyey29SP3a/Y+ZrvbVTiV0pJi/Ic2+CcrfFldjqD24PV7qI+411XfUxa8EPUlKN00Fg2rA8tuSJ+K3eIUuA5MH9tqqYwZ1OVXd2E+4b4Au6Gg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1733770597; 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=UCUyWepyHotuSHog4wQxtOXcYGnVWgzvFlwrr2hbZtY=; b=PCzaPWQE4/KHetJ4fD+Nq7FSo2Kxsf0flxCBUTg3sAmSN/G9/JAAM5xaGdlCJKrFDu49nZH8m5qEdBzNNByajn2laqX5y0vba2jEh6Q0aCMLus0U1cPwZ1u7YNSQuu5x/pynE7NNhRJOOjfjjOZH2jDvf3Sd9jxOhFsPkmP6CCg= 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=1733770596; 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=UCUyWepyHotuSHog4wQxtOXcYGnVWgzvFlwrr2hbZtY=; b=Y90OE4mViAeVkzbbCQ+v8pzdjHBzPVEfGFSDQZdffEn/kPr4TGm7A2jtnBd1m8un 9KH9iKCaYSNoigtyKpTHuFK5JsoBh4KTDZKJ9TCwYuDZjkbLAq9y5K54Wd770Cigj74 JN/2EJhKdLIGIKkQOItNPv363aUi9FJ1Tb3WxjZ0= Received: by mx.zohomail.com with SMTPS id 1733770595734477.42886681047787; Mon, 9 Dec 2024 10:56:35 -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 3/4] selftests/mm: mseal_test: remove unused variables Date: Mon, 9 Dec 2024 23:56:23 +0500 Message-Id: <20241209185624.2245158-4-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: 1755A80008 X-Stat-Signature: acr1qqf1txyao6zdrx1rh54i9pjtkup7 X-Rspam-User: X-Rspamd-Server: rspam11 X-HE-Tag: 1733770570-26224 X-HE-Meta: U2FsdGVkX1+awtQzfR361QGUfQ1DUI1NrWJzHfrAT+iwsBmnie2EGHDHpBU6CTPm1MsRNMWMk9KiWig/nrldzarJju+Hj8mhqKU3rYBSK51KusfJGiHvIqhMUrAkE341YxLE/gskNuTjzcSkQPA6Kg3uo+JMlkTp96zWzuYKWSfC/SFz5bxDXhWurTvTOfbqmFvFMklUG/cS4gtCBMo3JqYWzCMip8h3qS/Szhd9RZ/tysryOH9HIheLm4QfsvVjRnGTS2c5lPPvOpRACvGseUODFx4trk2QdCdkWrYmuZ036ENWC1t7Bgi7zIYPFa8zmYqr+6hC2j2V+ajpdIgoIJJYL+RfzI5F06wT34VOqgZbugKrs+QbtUXEOZ59pO8ZpFEkCBWZpMYc7XpXgblQZUk0VBH08FA41eU7KtRmvGro/eFUwPemB88yuzAxiw5WC9V0YEobjMaM+Hrvkep0Os6Rj6vfQRIi1NlGN4qDJfljVxJA5y2kCEzqWLQ+X2gJq4CayMMqB4OOo3E1lFhFXdwthz2oMWkRRyxgVV0FWM4hiHgkipcja6lxQiCQ+kJSeJ9/SdZOIRfONSv0vnzTN1sqcropkNMnqLlkWq5PUetsk/ePYGAAgLDELtXt41AsBNIcbZc6RdK3jjCxZoxkg4g2XlHWdbWJn8VGLM4gLgqoILZsFEF1+5X0gfOoTTckZLXdHRF+DH454sz6LhE1ZwgzkeFzMGO55l8y2oqe9iFxh+H4xf8oMlJDpRrRhq3ucI9pWg2JcxYHFap706whLXJx3Hnz/GnfE6dG9axdjJy1qudWJs6E7QGeTTdfDcJDms4qQ9l5qZ7J4FlVPPRnt6C8ux0fQ3WhDVk7TRSYI0AedN3tz8TYV33VMtaaFAtXxIDRgT8ucELeRgRFSJp7sReNEKJWybCQSMj4fDp71lmX+PI0MoaRhs/F7mbyOoUKmWeC0xTMZ31BPB7ehwa JKIPwZVG Y6rqsamA6tFZGojVfF1RKfIHartT5ZWs8qgO1tas4bl9dmgf4FBaxcKwDYeWd2PX0DLJcuLy+rAIPJYY8XoANMDq7lV3cuJymnuoFKBsAWgOdatPRGpxUeQHIaD5GiEYwi25XMFicW2TPoAc6IvFO1QcSl+IshSkX/BtQcX6UJA0BAI0hXlJAXAMNiwGkNzTfB431ZIRIlsWMkG4ZFe/UQlhFcThDcbr3SeQ5AkuAmGFsLSFa5txojKCZGC8v7QsQk/4hNXuB61S+jzKo/4aipfhW1FqEYR5Dlqvnky9PkQYSHIY9A72NVJyckP1/DvF+WA0qlMWmqlZCJH5VsphTj9+8FH6/6lZFcA+4Hymn6a7kHtIcEJvooAHUoQ== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000516, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Fix following warnings: - Remove unused variables and fix following warnings: Signed-off-by: Muhammad Usama Anjum --- tools/testing/selftests/mm/mseal_test.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/testing/selftests/mm/mseal_test.c b/tools/testing/selftests/mm/mseal_test.c index 01675c412b2a8..ad17005521a8e 100644 --- a/tools/testing/selftests/mm/mseal_test.c +++ b/tools/testing/selftests/mm/mseal_test.c @@ -802,7 +802,7 @@ static void test_seal_mprotect_partial_mprotect_tail(bool seal) } -static void test_seal_mprotect_two_vma_with_gap(bool seal) +static void test_seal_mprotect_two_vma_with_gap(void) { void *ptr; unsigned long page_size = getpagesize(); @@ -1864,7 +1864,7 @@ static void test_seal_madvise_nodiscard(bool seal) REPORT_TEST_PASS(); } -int main(int argc, char **argv) +int main(void) { bool test_seal = seal_support(); @@ -1913,8 +1913,8 @@ int main(int argc, char **argv) test_seal_mprotect_partial_mprotect(false); test_seal_mprotect_partial_mprotect(true); - test_seal_mprotect_two_vma_with_gap(false); - test_seal_mprotect_two_vma_with_gap(true); + test_seal_mprotect_two_vma_with_gap(); + test_seal_mprotect_two_vma_with_gap(); test_seal_mprotect_merge(false); test_seal_mprotect_merge(true); 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); }