From patchwork Mon Dec 9 09:50:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Brodsky X-Patchwork-Id: 13899185 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 36831E7717D for ; Mon, 9 Dec 2024 09:50:47 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id AE7818D0031; Mon, 9 Dec 2024 04:50:46 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A71DB8D0029; Mon, 9 Dec 2024 04:50:46 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8EA6B8D0031; Mon, 9 Dec 2024 04:50:46 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 6E8678D0029 for ; Mon, 9 Dec 2024 04:50:46 -0500 (EST) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 2CE961A0353 for ; Mon, 9 Dec 2024 09:50:46 +0000 (UTC) X-FDA: 82874950872.04.F1626B1 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf21.hostedemail.com (Postfix) with ESMTP id 8A6851C000E for ; Mon, 9 Dec 2024 09:50:05 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf21.hostedemail.com: domain of kevin.brodsky@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=kevin.brodsky@arm.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1733737835; a=rsa-sha256; cv=none; b=VtRzklkSqggOcC8tyKN6qX4aBEBW9nEyLlDS/xPbOTp9QJJYNxYGdcO9R36dPZL8R6WhMj reA/PJKsZ6BviNqZtL2Txc7GJY4/gsok3poEVIg+ySXtLqueKdCKfoS+q2KXEuanqwLfa+ VxEvAi28WQo0Q7/nQae34broNstAHew= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf21.hostedemail.com: domain of kevin.brodsky@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=kevin.brodsky@arm.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1733737835; 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; bh=HCzdiDFlbZh79PcakPauCEvqAaIH/wVADAjSs7kWDGA=; b=bhd1AVbPbLlQhSGu6gcLVloWWe8JIFzf2+LdMtfbSQ3Rz8j52O+F5XfwN7UOMOl4wNrcNK sByTWAHwuLMuZh1nH7yJzS3CbXEEo8BXme2jiJFG7ieqq84vEKGHIbJMDbEIbZ08gvgez7 R53+4g5jmkZomEctLpTFCzKnrNUH8uA= 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 F3C21113E; Mon, 9 Dec 2024 01:51:11 -0800 (PST) Received: from e123572-lin.arm.com (e123572-lin.cambridge.arm.com [10.1.194.54]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id EA0E13F720; Mon, 9 Dec 2024 01:50:41 -0800 (PST) From: Kevin Brodsky To: linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org, Kevin Brodsky , akpm@linux-foundation.org, aruna.ramakrishna@oracle.com, catalin.marinas@arm.com, dave.hansen@linux.intel.com, joey.gouly@arm.com, keith.lucas@oracle.com, ryan.roberts@arm.com, shuah@kernel.org, linux-arm-kernel@lists.infradead.org, linux-kselftest@vger.kernel.org, x86@kernel.org Subject: [PATCH 02/14] selftests/mm: Fix -Wmaybe-uninitialized warnings Date: Mon, 9 Dec 2024 09:50:07 +0000 Message-ID: <20241209095019.1732120-3-kevin.brodsky@arm.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241209095019.1732120-1-kevin.brodsky@arm.com> References: <20241209095019.1732120-1-kevin.brodsky@arm.com> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 8A6851C000E X-Stat-Signature: 1se1mbppf59zncfc1z9dwd4gu1yj1jgt X-HE-Tag: 1733737805-744461 X-HE-Meta: U2FsdGVkX1/hW2Rd7FhtYmeG5u5l7ANpXtNK0ufxxt55CkY4OWYGlLKCfB9XOa3dll+n5uU/8lQFQvJPx2fB3+h0072ZnToL6d2SPBi0j9m9qxJb9EIrGs1dUDlk9pVwLCnrexSD1f6ZjEidXdbwXTCTXQOzfkLOmfmeL3cZ8sB6WSSmGeoc6Gu8IKuPOkgITgwi18dhAcRaQlES38tE1WmL6zOLSMu64Zjtfhbh/606OIpwZg9fC3Zf+OnHCf3dsDhQgAG9oizBaPodQvqqJAvsONLRaIQvRFUQ3KzvTpQYQM3NcJ93V79ppXmZOtSVMl8u96kSBv94I7Uoo/vaZj23mu0fU6J/AOH+oeMiZCC8CMPTB21aPqlc+i0yBrx4b5d+rRfL1MCxFUy8QwYaw3npRkf3IJuHaD5n8qpyc+PjJ9387mqZ+5XWc7nEfObPF2bRnyDPu+trlwfo+fldmEqxYH6EaVmKROswXnB84FckhXV3UtyFRKoLDqFHCHOlo9JsgeG9pucBwJ0S15LuzREPC+quXwM3Sfd3cISYogNkTLidpKfiMKrbywO+dxMoRnIqqXkOm8JC5m9FaUpSneg7tg6RqGNfMotZj6ZV3HsoGmIk79VKQ/4RN1oHdOI4qpeANQTkUG17coazs6Ik4/DlYzIhvROeQlNQeC1ps2rK6Ie5QGHoRvWyiJGgnVkh0kmY5nAAlyEC88SQbDIhU13XLLo04pPOuK1yCcaPutw2Z2HiOW+sPLnMsLmATMBXQ1+CKo5xj40L/o+1lpxHCvWPji8GV914/mp7cd8mwozkvEn0+IhnoiaT4pXii2KRZp23xdg1WDcb9P95Q1OukIpMkw0iCiYUJh9z0CupqYbP3q/NMqaeUKedBbpVuzAlumhuOuS12+6SxDzbbYrRHBmesPmngfH6JfWNvtO33R4MHYwajxLehTWPz9n68Pousf/HxdVodCSPQfl7izQ N01eeTUk 9cTEjnQfFcKferft97IwniVvYTRQWFun9+2UKNmNTcbcCdd54pXWnKRD+WgmyzhSiXsPvkriUaLxXxEaVTvoiSWeynWTA7QPxV+U5Ug1tpNSACqOYqYoXQzfIH3C1D4WrOYZ1LStTp8o2yK8jyIKKW+9uyCZaPlFBWKpai3si1AeEV915BYVfa+b/QbXxuOh134VT72fLQzkvKvsAR67OjHeCGlUau9TZg/gJiTOojUlVepN9yIMtaKb9prIEvVisPrny 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: A few -Wmaybe-uninitialized warnings show up when building the mm tests with -O2. None of them looks worrying; silence them by initialising the problematic variables. Signed-off-by: Kevin Brodsky --- tools/testing/selftests/mm/ksm_tests.c | 2 +- tools/testing/selftests/mm/mremap_test.c | 2 +- tools/testing/selftests/mm/soft-dirty.c | 2 +- tools/testing/selftests/mm/uffd-unit-tests.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/testing/selftests/mm/ksm_tests.c b/tools/testing/selftests/mm/ksm_tests.c index b748c48908d9..dcdd5bb20f3d 100644 --- a/tools/testing/selftests/mm/ksm_tests.c +++ b/tools/testing/selftests/mm/ksm_tests.c @@ -776,7 +776,7 @@ static int ksm_cow_time(int merge_type, int mapping, int prot, int timeout, size int main(int argc, char *argv[]) { - int ret, opt; + int ret = 0, opt; int prot = 0; int ksm_scan_limit_sec = KSM_SCAN_LIMIT_SEC_DEFAULT; int merge_type = KSM_MERGE_TYPE_DEFAULT; diff --git a/tools/testing/selftests/mm/mremap_test.c b/tools/testing/selftests/mm/mremap_test.c index 5a3a9bcba640..056b227f4a30 100644 --- a/tools/testing/selftests/mm/mremap_test.c +++ b/tools/testing/selftests/mm/mremap_test.c @@ -384,7 +384,7 @@ static void mremap_move_within_range(unsigned int pattern_seed, char *rand_addr) static long long remap_region(struct config c, unsigned int threshold_mb, char *rand_addr) { - void *addr, *src_addr, *dest_addr, *dest_preamble_addr; + void *addr, *src_addr, *dest_addr, *dest_preamble_addr = NULL; unsigned long long t, d; struct timespec t_start = {0, 0}, t_end = {0, 0}; long long start_ns, end_ns, align_mask, ret, offset; diff --git a/tools/testing/selftests/mm/soft-dirty.c b/tools/testing/selftests/mm/soft-dirty.c index bdfa5d085f00..8e1462ce0532 100644 --- a/tools/testing/selftests/mm/soft-dirty.c +++ b/tools/testing/selftests/mm/soft-dirty.c @@ -128,7 +128,7 @@ static void test_mprotect(int pagemap_fd, int pagesize, bool anon) { const char *type[] = {"file", "anon"}; const char *fname = "./soft-dirty-test-file"; - int test_fd; + int test_fd = 0; char *map; if (anon) { diff --git a/tools/testing/selftests/mm/uffd-unit-tests.c b/tools/testing/selftests/mm/uffd-unit-tests.c index 74c884713bf7..9ff71fa1f9bf 100644 --- a/tools/testing/selftests/mm/uffd-unit-tests.c +++ b/tools/testing/selftests/mm/uffd-unit-tests.c @@ -1122,7 +1122,7 @@ uffd_move_test_common(uffd_test_args_t *targs, unsigned long chunk_size, char c; unsigned long long count; struct uffd_args args = { 0 }; - char *orig_area_src, *orig_area_dst; + char *orig_area_src = NULL, *orig_area_dst = NULL; unsigned long step_size, step_count; unsigned long src_offs = 0; unsigned long dst_offs = 0;