From patchwork Thu Jan 9 17:38:26 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muhammad Usama Anjum X-Patchwork-Id: 13933029 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 B637AE77197 for ; Thu, 9 Jan 2025 17:39:05 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 51D146B0085; Thu, 9 Jan 2025 12:39:05 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 4CD106B0088; Thu, 9 Jan 2025 12:39:05 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 36D976B0089; Thu, 9 Jan 2025 12:39:05 -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 1676E6B0085 for ; Thu, 9 Jan 2025 12:39:05 -0500 (EST) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id AD33E1402FD for ; Thu, 9 Jan 2025 17:39:04 +0000 (UTC) X-FDA: 82988624208.21.A893A77 Received: from sender4-pp-f112.zoho.com (sender4-pp-f112.zoho.com [136.143.188.112]) by imf07.hostedemail.com (Postfix) with ESMTP id ACE0740002 for ; Thu, 9 Jan 2025 17:39:02 +0000 (UTC) Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=collabora.com header.s=zohomail header.b=NiVeLQGH; spf=pass (imf07.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=pass ("zohomail.com:s=zohoarc:i=1") ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1736444342; 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-type: content-transfer-encoding:content-transfer-encoding:in-reply-to: references:dkim-signature; bh=E5lvGfPhJCrdgpWIOv0+xLeRXWy6owHBeDWNShBCLX0=; b=r3uv31hYUV7e5OlbAe2yffckvQ1UxqsqlvL8oFB0AU8UV49uumFVIZMFxlPLzrBNCvHvmZ aqXefaoamCrLpUYTLuvg/Uri1hgArkQ4vZoT/JPRtMxaBnxFl/es+3XkrrAoSD049qaENj AZvvyImQxEj0tefXDCdaaoBXbWwi3aQ= ARC-Authentication-Results: i=2; imf07.hostedemail.com; dkim=pass header.d=collabora.com header.s=zohomail header.b=NiVeLQGH; spf=pass (imf07.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=pass ("zohomail.com:s=zohoarc:i=1") ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1736444342; a=rsa-sha256; cv=pass; b=qFsRGFVVdZVCDYPLYUNh+OxBLX270whLBbEvfL4qr9QGfoCU7h+n6i3z+VVQjNtCb5ADpL Sgt9GZm3mvZPbxSTBZ9N5id9Zz4e2Rgrw8HGrWkM2Bg+049lbxt8ZNeXlh5t/hc+mXvz97 4podL3pTmDYSSSQH1Q5pTKsv+gB3+Rg= ARC-Seal: i=1; a=rsa-sha256; t=1736444329; cv=none; d=zohomail.com; s=zohoarc; b=X7gvn2H6vDyOWcB530rjEqr6sOydURpP3fosCAB+9Ev8YV045RZJiesbllY4Wp5xHoM6KE6quLRf0lRgrL5QOOj6Ff8O2WnIPDANlEvRoEyWbcKvZ5oCdZdefXqNDByF5WRXaR8B5syFAw3sV8T1KLPs5C5eSAI7EVsko3dcwtE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1736444329; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:MIME-Version:Message-ID:Subject:Subject:To:To:Message-Id:Reply-To; bh=E5lvGfPhJCrdgpWIOv0+xLeRXWy6owHBeDWNShBCLX0=; b=bku0ZbP8Cibt2Cyd1MLafZYWs8tdW8kn9WGhRxpsK4Rr4pVhXz0uGNqZlvNuEbtfV2yHV9pD0zU6j9Q9bH/zDZ/X60qVqJQy4Lcbv9uGVvAS2Qdq3GRLqXZ6dDvpHRRy7vrnRiP2uKWpf9wD+v9RRoW9AU2Ti37Jlhgf66EuEGo= 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=1736444329; 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:MIME-Version:Content-Type:Content-Transfer-Encoding:Reply-To; bh=E5lvGfPhJCrdgpWIOv0+xLeRXWy6owHBeDWNShBCLX0=; b=NiVeLQGHhJ+U+92e4jJ3RYo8fjFBggJiQ6ov5OS3wKMoYfiE6uMOvznhO3/YU0Zf 9zY0j9EMOm4yVA2tNfTr/UCNZ6Vdgm1vnGQ79BCb03N34tru0A0TywU7UIickJKl0/u 8ayGCsxeTyUZUyPflXPyOmTgjvaIkWNcwZ9JgEYs= Received: by mx.zohomail.com with SMTPS id 1736444327359273.5270312514208; Thu, 9 Jan 2025 09:38:47 -0800 (PST) From: Muhammad Usama Anjum To: Kees Cook , Andy Lutomirski , Will Drewry , Shuah Khan , Andrew Morton , =?utf-8?b?SsOpcsO0bWUgR2xpc3Nl?= , linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: Muhammad Usama Anjum , kernel@collabora.com Subject: [PATCH 00/16] selftest/mm: Remove warnings found by adding compiler flags Date: Thu, 9 Jan 2025 22:38:26 +0500 Message-Id: <20250109173842.1142376-1-usama.anjum@collabora.com> X-Mailer: git-send-email 2.39.5 MIME-Version: 1.0 X-ZohoMailClient: External X-Rspamd-Server: rspam05 X-Stat-Signature: xdp8esnqgutb4zxhhg7usz7n6aihjctp X-Rspamd-Queue-Id: ACE0740002 X-Rspam-User: X-HE-Tag: 1736444342-923722 X-HE-Meta: U2FsdGVkX1985baDcxXi1FjYTmnuViow3iKk6qW7w6s1FjVQTQ9uY/bvL3bE5T3v1C09LHl+aWspQtPWFxbs/6rrcPLaSK8fLh/XxLB8EExAMhj9iiwGdT+UmlKVoCY6fAjAlmaNGSBsYY456nEpoRXz0pnefA3ggQuCMDtcq9MJhn1AdyxRSOFNQCB9+G22nvgmGKYgxlV8qx2OJ6s8M12L7tawj87VGCdpX0Q4UvMiLU1lxdYoPA91NG0ObsmiZSsfCbqKaT+622vMsKKfmZZe8zvEjdF40wuhj0fx9fSzMsuBvt4F0kh+WDAh2GryHFE41Scf0OZVPW7QLKna9HuNbYeZYr0TSl3GZszaT5Z6DPeXYDYFOqcpooEGeufWE8k8tJrbtSKx5CGosbDJ+h8crB1lu4SFZ6Yok7Z3NvTXClC58M93aQMd2WVtIZHHhQaftqiXv1kM/a/NhxCJer+GAMaKNJmPocvUuG4bLlksbL0sZbN4cSkoiT4J1BsG7BVcup2GuqXdHqktMd34Pg4shIGtw7QpBYiQ7qp5AwinmjQYf5pgYxFMo/V7DifQzsCHhzrz3zm1BdzMnF9GCGcHF4E1ifpQwWt0G4R8TXsg1W9JBm3og5UrEslsyI//iVpQt0WNos1+ZDkMhP3rCXpbDS8mPLlt5iS1Oqyu5vm7MtwwDK1PO/MNy3TnYR+dV7PjYpPvvx6FSoKQogBgOU0Fq4NMw3mIDjsgKKeCPqoziBqZtkvtAlPmbrHSeQeSFyLI5pRigjVKM7ONEhTNOYmDLf+mdcH1RVFM4fw+3E5naWnM2uplBYunv3lOZCU7r76OmLULzc30vn5NLw2WBPASBIQpFz5r7V1wc/RlvbUtBMBn5buIR+jY3EEQ3nRzmgTbLfMFVHYleh4/eqpWFK98g25IV8wfvnJcx8VRJcC914ttn+vVPW1y5UetnXLWXxo/lPVR3GcDX9kXxc5 1QV5dfOK bhAdRCTI4pC3QuIPWvJdo+AJi9DmAVJ5tI/tVbOXGxXvxwWBLNzuMkvEFv89PBb1BysDDuRH2PcSztFh4V1pkxEEqmshULKLaZ5Ag6XlEIjTUhIUzfRLlxQLzX4xeouC2jCsva9lBElh+xdJ4kkzZ9qlqSFqH/G7psgm+DaMnTqN2EqPsgMJv6kCg5Px7Fgn6geaR8ekOi5jo+Jbm3mbg0rMGgFVhfgkUfzHXtuZ3S/wVKDKcyu7nk4PN8OFPjKOMSub93HhrHIv3Ga+qT9XTGHHX+g== X-Bogosity: Ham, tests=bogofilter, spamicity=0.001473, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Recently, I reviewed a patch on the mm/kselftest mailing list about a test which had obvious type mismatch fix in it. It was strange why that wasn't caught during development and when patch was accepted. This led me to discover that those extra compiler options to catch these warnings aren't being used. When I added them, I found tens of warnings in just mm suite. In this series, I'm fixing those warnings. The last check adds the compiler flags with which the warnings have been caught. Muhammad Usama Anjum (16): selftests/mm: remove argc and argv unused parameters selftests/mm: Fix unused parameter warnings selftests/mm: Fix unused parameter warnings selftests/mm: Fix type mismatch warnings selftests/mm: kselftest_harness: Fix warnings selftests/mm: cow: remove unused variables and fix type mismatch errors selftests/mm: hmm-tests: Remove always false expressions selftests/mm: guard-pages: Fix type mismatch warnings selftests/mm: hugetlb-madvise: fix type mismatch issues selftests/mm: hugepage-vmemmap: fix type mismatch warnings selftests/mm: hugetlb-read-hwpoison: Fix type mismatch warnings selftests/mm: khugepaged: Fix type mismatch warnings selftests/mm: protection_keys: Fix variables types mismatch warnings selftests/mm: thuge-gen: Fix type mismatch warnings selftests/mm: uffd-*: Fix all type mismatch warnings selftests/mm: Makefile: Add the compiler flags tools/testing/selftests/kselftest_harness.h | 6 +- tools/testing/selftests/mm/Makefile | 1 + tools/testing/selftests/mm/compaction_test.c | 4 +- tools/testing/selftests/mm/cow.c | 48 ++++++++------- tools/testing/selftests/mm/droppable.c | 2 +- tools/testing/selftests/mm/guard-pages.c | 4 +- tools/testing/selftests/mm/gup_longterm.c | 5 +- tools/testing/selftests/mm/hmm-tests.c | 4 +- tools/testing/selftests/mm/hugepage-vmemmap.c | 5 +- tools/testing/selftests/mm/hugetlb-madvise.c | 4 +- .../selftests/mm/hugetlb-read-hwpoison.c | 6 +- .../selftests/mm/hugetlb-soft-offline.c | 2 +- tools/testing/selftests/mm/hugetlb_dio.c | 2 +- .../selftests/mm/hugetlb_fault_after_madv.c | 6 +- .../selftests/mm/hugetlb_madv_vs_map.c | 8 +-- tools/testing/selftests/mm/khugepaged.c | 16 ++--- .../selftests/mm/ksm_functional_tests.c | 6 +- tools/testing/selftests/mm/ksm_tests.c | 17 +++--- tools/testing/selftests/mm/madv_populate.c | 2 +- tools/testing/selftests/mm/map_populate.c | 2 +- tools/testing/selftests/mm/memfd_secret.c | 6 +- .../testing/selftests/mm/mlock-random-test.c | 6 +- tools/testing/selftests/mm/mlock2-tests.c | 2 +- tools/testing/selftests/mm/on-fault-limit.c | 2 +- tools/testing/selftests/mm/pkey-x86.h | 4 +- .../selftests/mm/pkey_sighandler_tests.c | 21 ++++--- tools/testing/selftests/mm/protection_keys.c | 34 ++++++----- tools/testing/selftests/mm/soft-dirty.c | 8 +-- .../selftests/mm/split_huge_page_test.c | 4 +- tools/testing/selftests/mm/thuge-gen.c | 10 ++-- tools/testing/selftests/mm/uffd-common.c | 24 ++++---- tools/testing/selftests/mm/uffd-common.h | 2 +- tools/testing/selftests/mm/uffd-stress.c | 4 +- tools/testing/selftests/mm/uffd-unit-tests.c | 58 +++++++++---------- tools/testing/selftests/mm/uffd-wp-mremap.c | 2 +- .../selftests/mm/virtual_address_range.c | 2 +- 36 files changed, 180 insertions(+), 159 deletions(-)