From patchwork Fri Nov 1 11:15:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mirsad Todorovac X-Patchwork-Id: 13859239 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 4823EE6B240 for ; Fri, 1 Nov 2024 11:17:13 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C35826B0082; Fri, 1 Nov 2024 07:17:12 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id BBE926B0083; Fri, 1 Nov 2024 07:17:12 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A37B46B0085; Fri, 1 Nov 2024 07:17:12 -0400 (EDT) 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 80F906B0082 for ; Fri, 1 Nov 2024 07:17:12 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id F32BC141D5B for ; Fri, 1 Nov 2024 11:17:11 +0000 (UTC) X-FDA: 82737273150.09.82A8AF7 Received: from mail-ej1-f45.google.com (mail-ej1-f45.google.com [209.85.218.45]) by imf28.hostedemail.com (Postfix) with ESMTP id A0513C0006 for ; Fri, 1 Nov 2024 11:16:41 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=ONtIYhYd; spf=pass (imf28.hostedemail.com: domain of mtodorovac69@gmail.com designates 209.85.218.45 as permitted sender) smtp.mailfrom=mtodorovac69@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1730459698; 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:references:dkim-signature; bh=YtArAmKRSjy4GcchaiNpaMfT3D/wOjJsG1VCp35IVxY=; b=zq46MuPon7/cHy/SIee4HIix6c5mBUZsXlUVhn0SHaS/7/l++A/ZDMqiGgi6swsN1ttAVM FTrGEru5Z4h2zYBux06y0QibTKYkdmRv+GUJ24mECUY9+s0vvvp8t3sq9VlUrM0Vu4lhrU H4v5w9XE84Isgh7H4YvwqodN1Pwfudw= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1730459698; a=rsa-sha256; cv=none; b=OSpBPjr6K9xQOZ1f/3XoxEKVnvBinNIuRuelW9i8YDkH56A1Lvouz95obLNoyUjXJAl8R7 7WrQwdEbayZwCwKrMVaZR3dpZlqefTQzbKTRHjOuqIS/uSh3wknNu1LMNlJln2c7soTvYJ DOcovFaukoYUywodm1tlWOdb+RbFJ+4= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=ONtIYhYd; spf=pass (imf28.hostedemail.com: domain of mtodorovac69@gmail.com designates 209.85.218.45 as permitted sender) smtp.mailfrom=mtodorovac69@gmail.com; dmarc=pass (policy=none) header.from=gmail.com Received: by mail-ej1-f45.google.com with SMTP id a640c23a62f3a-a99f1fd20c4so239317366b.0 for ; Fri, 01 Nov 2024 04:17:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730459829; x=1731064629; darn=kvack.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=YtArAmKRSjy4GcchaiNpaMfT3D/wOjJsG1VCp35IVxY=; b=ONtIYhYdreKcow42RGyBg2VBgTqRYqKOtt+KurQHjqepgZqStgGDenNWGU+p11zr1X mvY69yakU1I3B372RGjup1Tn5MwSSgGZ4wiRUrs9prCWr3JdMCcCNM+jrjZeIzwoRuG7 3uMQ2WY4GWd4RiXriqbZgT1MswISdbYQwJ6uxImbrAxyDmWmP0Cyy3UJGEZ/vbV7iAs7 1gAvvAoNI01XaBeqXncGNx4nvDiX3tAcDEGv6IkHSOUA32W2QILJGHgolXHPsbZPW2Bf fnTzFJSJ9PceKF8dvI6wIeG4T6IeZ1pxZ1jnB8Cx82+gBFZbk0I71fpHFrJnv9gHE42k 5NLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730459829; x=1731064629; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=YtArAmKRSjy4GcchaiNpaMfT3D/wOjJsG1VCp35IVxY=; b=MySm+je4+8LvJaAcyxJGo2tqI7EZ+8SPVwt1/OiXGRbOwzDTFVaIDKw4No9OgxpJ1c GU/+i6ZUOMJKS+RJzYvj3HYviVX2JTQIa9Du/TkHman77tAq8NCzYZ9QEqzKHYMDzdeU E+XDhMDLmfc2gXQGCT35vQizhFn8alfKOGNtQxp1TTc3fWp6l0kzDTzvhek8sPxoxFSs L5EZ9T3/nFMIf/YwbMLwqiZUXQYtXP15cX2Ybxgh5lIXS2qZeO57qW2UVnYV7CbvjcYG Tn+qmedhyZ6uAmccol+XKcknQslBcyFQbH8YboeXUF/bV4eygOtp1eYkBW8pDp/dFQvL vW4g== X-Forwarded-Encrypted: i=1; AJvYcCXZLOLei4LlyKzDU4OKMF8cC0sVzX9DAacQmxhu+aCEztQWcYlkj/moxNfMUNy8ci5Lvy7oFb4RdA==@kvack.org X-Gm-Message-State: AOJu0YxtQCpDESrMhloVmu78mnINSKTre+rXvezWHagvOrfZkzM68P/Y XitECrUaEI+SzhCu6O3pyGQOpbIIpKIFiQ2VYkvHi7+0uoy1QMHF X-Google-Smtp-Source: AGHT+IGYOswi8GmANhJOnv4qTAd/hplNOcov2HOYf1vVwLcaSpO9QPvPflM28+q+u9Xe2bf6/pIihA== X-Received: by 2002:a17:907:72d6:b0:a9a:14fc:9868 with SMTP id a640c23a62f3a-a9e5089b6b2mr555416066b.4.1730459828356; Fri, 01 Nov 2024 04:17:08 -0700 (PDT) Received: from localhost (dh207-40-94.xnet.hr. [88.207.40.94]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9e565df949sm168711466b.121.2024.11.01.04.17.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Nov 2024 04:17:08 -0700 (PDT) From: Mirsad Todorovac To: Andrew Morton , Suren Baghdasaryan , Mirsad Todorovac , linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Shuah Khan , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" Subject: [PATCH v1 1/2] selftests/x86/syscall: fix coccinelle WARNING recommending the use of ARRAY_SIZE() Date: Fri, 1 Nov 2024 12:15:23 +0100 Message-ID: <20241101111523.1293193-2-mtodorovac69@gmail.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: A0513C0006 X-Stat-Signature: mp7rc66dqu1z67dstnmktg9u7iijgipw X-HE-Tag: 1730459801-401169 X-HE-Meta: U2FsdGVkX19OJXNNP/XS6u1ni1J2UA68wJ9flI2xPbe32FoUuffQnVxUrelih8/LH86PRQaNDtGovFOXvjFgj6EwdRDJduDJ24u4MTZkqEsD9kgv3fv76ohnA5wnhUKicrxxLOwa3y/FiT5zTp0qzpuUxzkSFslhRSzhlrrovKxsOw/koYx7Pdb/ftmq8Cxjl8/vnydA3yOWU0mNAocrQrU/X+7FvVafJoGzU8odi7S1nuCYrK5soFyQAdaWxi8ntvk00Gf6LqrJeSN8MsVNFbQgGhwoW0qz85qY7Oxd4Pkj9e1BTuH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IdWWvFYMExxJ9jeJ69rDpTQOiNoXJNHJlRCSQPD3R4PfmJkK3OkKSQPshPPsn0m3dmzrTisULz/u9hNCfAe1zazVKqTa1oSbMKac2GfPv2ydamG5RYIkB8QXx9YIRHWtckdYALseCPHluny+lN3QSl99BbQU= 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: Coccinelle gives WARNING recommending the use of ARRAY_SIZE() macro definition to improve the code readability: ./tools/testing/selftests/x86/syscall_numbering.c:316:35-36: WARNING: Use ARRAY_SIZE Fixes: 15c82d98a0f78 ("selftests/x86/syscall: Update and extend syscall_numbering_64") Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: Dave Hansen Cc: x86@kernel.org Cc: "H. Peter Anvin" Cc: Shuah Khan Cc: linux-kernel@vger.kernel.org Cc: linux-kselftest@vger.kernel.org Signed-off-by: Mirsad Todorovac Reviewed-by: Muhammad Usama Anjum --- v1: initial version. tools/testing/selftests/x86/syscall_numbering.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/x86/syscall_numbering.c b/tools/testing/selftests/x86/syscall_numbering.c index 991591718bb0..41c42b7b54a6 100644 --- a/tools/testing/selftests/x86/syscall_numbering.c +++ b/tools/testing/selftests/x86/syscall_numbering.c @@ -25,6 +25,7 @@ #include #include +#include "../kselftest.h" /* Common system call numbers */ #define SYS_READ 0 @@ -313,7 +314,7 @@ static void test_syscall_numbering(void) * The MSB is supposed to be ignored, so we loop over a few * to test that out. */ - for (size_t i = 0; i < sizeof(msbs)/sizeof(msbs[0]); i++) { + for (size_t i = 0; i < ARRAY_SIZE(msbs); i++) { int msb = msbs[i]; run("Checking system calls with msb = %d (0x%x)\n", msb, msb); From patchwork Fri Nov 1 11:15:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mirsad Todorovac X-Patchwork-Id: 13859240 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 9360FE6B240 for ; Fri, 1 Nov 2024 11:17:32 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 29ABA6B007B; Fri, 1 Nov 2024 07:17:32 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2221E6B0085; Fri, 1 Nov 2024 07:17:32 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0C2EA6B0088; Fri, 1 Nov 2024 07:17:32 -0400 (EDT) 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 DBA306B007B for ; Fri, 1 Nov 2024 07:17:31 -0400 (EDT) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 1C66C161CA9 for ; Fri, 1 Nov 2024 11:17:29 +0000 (UTC) X-FDA: 82737274830.16.D175C4E Received: from mail-ej1-f51.google.com (mail-ej1-f51.google.com [209.85.218.51]) by imf01.hostedemail.com (Postfix) with ESMTP id 21D374000F for ; Fri, 1 Nov 2024 11:17:04 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=NzKqrBCx; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf01.hostedemail.com: domain of mtodorovac69@gmail.com designates 209.85.218.51 as permitted sender) smtp.mailfrom=mtodorovac69@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1730459684; a=rsa-sha256; cv=none; b=iayOyPgK5IPJ6dW17zRzxhQoYs9sTA35VS0ix2iknMqE/OGwDvruxzCgwmg+BjtJDAikJd QzE0lRImh71ZA6tHgTKap92aDITlCpdY2IprVCqyTjO0z1I/CXXjpFf4aaDZ29HtvA+V/O yV7YNxSgoGisy0Y618ZCZayLprrCOH8= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=NzKqrBCx; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf01.hostedemail.com: domain of mtodorovac69@gmail.com designates 209.85.218.51 as permitted sender) smtp.mailfrom=mtodorovac69@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1730459684; 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=owNM3/QzlAhNtYzONHthhBgzoBUFnEtJ8clA/gqOqP8=; b=3pgVuEf9yexjdIIZWc3sndO7V4Ostp3hTPBOzKs41HCNisEtpj1CRMkdW05b3FwekloI7r LUNgVRTI3UtnrMg7Qe/Q0VFXuEGCiYmdx1wd0P5KsiKcFxvKlBhC5DBdbNHJF+rP4kc2v0 dHkg9UWR1G5vda6hL7GqIs0urtqFDhA= Received: by mail-ej1-f51.google.com with SMTP id a640c23a62f3a-a9e44654ae3so206360166b.1 for ; Fri, 01 Nov 2024 04:17:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730459846; x=1731064646; darn=kvack.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=owNM3/QzlAhNtYzONHthhBgzoBUFnEtJ8clA/gqOqP8=; b=NzKqrBCxhglejoV2QjWgGjh5HtCJBrrE+2bhUPTps2RL5hwJCFvOneteYMn9+PH4qR wcwW3EllQzLonXrIw1x7pJ0ub6by18MQ2DbrQflqEAHb+tN4ANfV3W7Im2JStic+ZLeY 2iDUfPOWKKnauaRhxbsi8WCa1Ohmdq/rJ6ks8Ws5nfDcDmQWVQxPiil/jMGfiQS21nSQ 8wHPo3jz+c4DS+R8QUz/OFT+5J/aUcMO2b9rVvEwDXNkrzOp5gQdfblSrHOsFYdOaepn zkOKWnq5vQ2vvWroNhcwKjqDT9DomrzRYVVHKdNQgqTbZNdpLwkPKQa+cOnblryFeSjm pVhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730459846; x=1731064646; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=owNM3/QzlAhNtYzONHthhBgzoBUFnEtJ8clA/gqOqP8=; b=JI7DYcANbdt7H72vX+jBeA/VBEnrolqsq4YVkVWtrI7K3poXDNoRf4KUVzU05ZgTho 5xYYzyehdfZPupswMLQ0uSlaiZzqiHmJaXFexr+hycNlVgIzdeAC+7Vi+O9ikNNRaMV9 NW9CAp1UYvUp97wdPl6qUSKaBlnlJ1cmdYhI0pQn1VUBzkwJjHFTNXFpcYJ6EwBevbd/ RzILg16jrBhpBtAXbi342h+Rf4GxFHKYSAG6vIABw3IVqgqpjYqbqrzhQJkRT9Swsh0Y BvlnGAX+5XQpBGrjkbZyVxWus4WsaFp/Pf9ECloh6y1B+WAX29Hkuly+eRPF3ITa/sry 1iQg== X-Forwarded-Encrypted: i=1; AJvYcCVkz2Jdsfl3OwpwHBllG2t0xGvMKv0GNr9ir0rYSbXF5pVm5tC0Byd0poYRj0sKER+Tb7LxqGXdWQ==@kvack.org X-Gm-Message-State: AOJu0YxX5Tubv/a52G1nspqCGmXbtT8Q3IONDDyVZqSo6v8t7tiSrr9K 7Z8dVBtkjCdCHRKFwcQKKJHG6BNO2tZXruHXEM7tLGJ/dQpMOm0k X-Google-Smtp-Source: AGHT+IGcNVKqsisXLQ6ZTw8bj6zkCrJ2Fi6FOroGRITjh3Eiw9Wx7lM7MdorBUvTtiDM49X2w7QDGg== X-Received: by 2002:a17:907:6d12:b0:a99:d782:2e2b with SMTP id a640c23a62f3a-a9e50938952mr539160766b.30.1730459845500; Fri, 01 Nov 2024 04:17:25 -0700 (PDT) Received: from localhost (dh207-40-94.xnet.hr. [88.207.40.94]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9e56494068sm169226566b.31.2024.11.01.04.17.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Nov 2024 04:17:25 -0700 (PDT) From: Mirsad Todorovac To: Andrew Morton , Suren Baghdasaryan , Mirsad Todorovac , linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Shuah Khan , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Peter Xu Subject: [PATCH v1 2/2] selftests/mm: fix coccinelle WARNING recommending the use of ARRAY_SIZE() Date: Fri, 1 Nov 2024 12:15:25 +0100 Message-ID: <20241101111523.1293193-4-mtodorovac69@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241101111523.1293193-2-mtodorovac69@gmail.com> References: <20241101111523.1293193-2-mtodorovac69@gmail.com> MIME-Version: 1.0 X-Stat-Signature: kebnwmaddogwh6fnndd8c4w67dw5w1t8 X-Rspamd-Queue-Id: 21D374000F X-Rspamd-Server: rspam08 X-Rspam-User: X-HE-Tag: 1730459824-8619 X-HE-Meta: U2FsdGVkX1/7fKINTitwAJSb8ITP7A0RTkzdTxPtcfaqu7UuIlwDE7Fbm3hKqRbnJVh/HSX9cUQTiromb0FeZLfs3eePr2j5a66L8lzIc1zGYVSSTrPd2AMnKWV/uU2kRUfAVzUoV8xcZbyTmdgx6OR8Esl97E8Mp1fzP0ZQHAZ/YMzq2qVCSwKWvBzDSJMFTQtbR4M28tI7B/lWcX+kX9Fr9kaKNaVa1HzfSBr49QnqScCP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LdteeriMvZ2Mhh4k9HFi3jJB74twmeugEvJVoUoLThwbkKThvK/Mfh6J3+0M+0cgA9CVHT/mf9QYa06JHe48h2JmdZ4niF76P51hDAj2iUMmEHsPCcNEyXnPE6fMCONkqO3M6ty/bDCQpOf/nN9OjuZPgzuhsVsaZg+BHJX8GSrMIBzFylXOERL7nqBatZVSqHJxW+hsNh/jt4SHDLHQg/Xi7RZdH1fl1ouZSYy5uwb5DFY9XbBVoD4pweOuNdOU8Q== 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: Coccinelle gives WARNING recommending the use of ARRAY_SIZE() macro definition to improve the code readability: ./tools/testing/selftests/mm/uffd-unit-tests.c:1484:32-33: WARNING: Use ARRAY_SIZE ./tools/testing/selftests/mm/uffd-unit-tests.c:1485:30-31: WARNING: Use ARRAY_SIZE Fixes: 16a45b57cbf2 ("selftests/mm: add framework for uffd-unit-test") Cc: Andrew Morton Cc: Shuah Khan Cc: Peter Xu Cc: linux-mm@kvack.org Cc: linux-kselftest@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Mirsad Todorovac Acked-by: Peter Xu --- v1: initial version. tools/testing/selftests/mm/uffd-unit-tests.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/mm/uffd-unit-tests.c b/tools/testing/selftests/mm/uffd-unit-tests.c index a2e71b1636e7..4f6a7440a9aa 100644 --- a/tools/testing/selftests/mm/uffd-unit-tests.c +++ b/tools/testing/selftests/mm/uffd-unit-tests.c @@ -1481,8 +1481,8 @@ static void usage(const char *prog) int main(int argc, char *argv[]) { - int n_tests = sizeof(uffd_tests) / sizeof(uffd_test_case_t); - int n_mems = sizeof(mem_types) / sizeof(mem_type_t); + int n_tests = ARRAY_SIZE(uffd_tests); + int n_mems = ARRAY_SIZE(mem_types); const char *test_filter = NULL; bool list_only = false; uffd_test_case_t *test;