From patchwork Fri Dec 10 17:33:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shuah Khan X-Patchwork-Id: 12670449 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 CB522C433EF for ; Fri, 10 Dec 2021 17:34:04 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4A7776B0073; Fri, 10 Dec 2021 12:33:38 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 456106B0074; Fri, 10 Dec 2021 12:33:38 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 31E7E6B0075; Fri, 10 Dec 2021 12:33:38 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 24ADB6B0073 for ; Fri, 10 Dec 2021 12:33:38 -0500 (EST) Received: from smtpin16.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id DCE488249980 for ; Fri, 10 Dec 2021 17:33:27 +0000 (UTC) X-FDA: 78902581254.16.F8ABE80 Received: from mail-ot1-f42.google.com (mail-ot1-f42.google.com [209.85.210.42]) by imf25.hostedemail.com (Postfix) with ESMTP id 70DD8A0010 for ; Fri, 10 Dec 2021 17:33:26 +0000 (UTC) Received: by mail-ot1-f42.google.com with SMTP id x43-20020a056830246b00b00570d09d34ebso10344926otr.2 for ; Fri, 10 Dec 2021 09:33:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=MYhfIoJvlZ3UvjgjTfCOCi8477KYN3hMlQaW6RBS+ig=; b=af9yfAM2vzCaX+swy2klbMoSrH2tkjLgvNjPp0zQZByY6sB9n0hkrMVuGwo8y7p4sl iEWkYM32+PBDmuzOdK0fJYMVX7YbtQRe7QOqh9iRvdW29YJVTnwap6Ilz1qoldCsQCyH 0rote55FZD2B/vSw6df149TN+E2Br2fgnwzyc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=MYhfIoJvlZ3UvjgjTfCOCi8477KYN3hMlQaW6RBS+ig=; b=TnPTOtegXM+SZoVetKV0CeVIXiVR3GdIstUMVbxtHpgw9HMobA7Ut6/Z0BgK7qHpXx Ss5yKElNmelItvx2QkkCR0F/WOJvESHJNNiLYNeWbJjTTL85Z5iHDVhtKAMRYPK20k8d IC/GFmoh9h10MB7XRXjvo9H9fl6uM4iwBDfDlT18SRrFx2G18SidsPdXmP/N2PkiWiRJ QAx7TFcIXpB6iQ7GJvj7tg6nxX7InrqtIVk0rSWj+lR8qGx7FTu92wDCovatq6aF4vQT XZ8Te5PImyFYdc3PLMC8I6h6mc/hdpzkbU4hryD/S+yBA4zA2bxUf7gppaZ9CxlBa5ks Werw== X-Gm-Message-State: AOAM530orsSva4IJhV+PdINGOX5d/GhmkPDI/8DxeoSBUjWjNVDRIGv4 aZTTBOJMT3/1EhW7lS070gBzoA== X-Google-Smtp-Source: ABdhPJz+fdxZhcaBb0aXL1/U4YYsysQrmZmbnuOBIm+WLfQTPZbTuKYEVakW8zy1Ps1nYPL431Nd1w== X-Received: by 2002:a9d:69ce:: with SMTP id v14mr12130459oto.312.1639157606779; Fri, 10 Dec 2021 09:33:26 -0800 (PST) Received: from shuah-t480s.internal (c-24-9-64-241.hsd1.co.comcast.net. [24.9.64.241]) by smtp.gmail.com with ESMTPSA id x4sm892224oiv.35.2021.12.10.09.33.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Dec 2021 09:33:26 -0800 (PST) From: Shuah Khan To: catalin.marinas@arm.com, will@kernel.org, shuah@kernel.org, keescook@chromium.org, mic@digikod.net, davem@davemloft.net, kuba@kernel.org, peterz@infradead.org, paulmck@kernel.org, boqun.feng@gmail.com, akpm@linux-foundation.org Cc: Shuah Khan , linux-kselftest@vger.kernel.org, linux-security-module@vger.kernel.org, netdev@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 01/12] tools: fix ARRAY_SIZE defines in tools and selftests hdrs Date: Fri, 10 Dec 2021 10:33:11 -0700 Message-Id: <30585e0f0acfb523c6f7a93e0b916ae756e0c7e7.1639156389.git.skhan@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: References: MIME-Version: 1.0 X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 70DD8A0010 X-Stat-Signature: aq94zk5cghnj41fzp84gjcx8ngffjpro Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=linuxfoundation.org header.s=google header.b=af9yfAM2; spf=pass (imf25.hostedemail.com: domain of skhan@linuxfoundation.org designates 209.85.210.42 as permitted sender) smtp.mailfrom=skhan@linuxfoundation.org; dmarc=pass (policy=none) header.from=linuxfoundation.org X-HE-Tag: 1639157606-953423 X-Bogosity: Ham, tests=bogofilter, spamicity=0.001656, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: tools/include/linux/kernel.h and kselftest_harness.h are missing ifndef guard around ARRAY_SIZE define. Fix them to avoid duplicate define errors during compile when another file defines it. This problem was found when compiling selftests that include a header with ARRAY_SIZE define. ARRAY_SIZE is defined in several selftests. There are about 25+ duplicate defines in various selftests source and header files. Add ARRAY_SIZE to kselftest.h in preparation for removing duplicate ARRAY_SIZE defines from individual test files. Signed-off-by: Shuah Khan Reviewed-by: Kees Cook --- tools/include/linux/kernel.h | 2 ++ tools/testing/selftests/kselftest.h | 4 ++++ tools/testing/selftests/kselftest_harness.h | 2 ++ 3 files changed, 8 insertions(+) diff --git a/tools/include/linux/kernel.h b/tools/include/linux/kernel.h index 3e8df500cfbd..9701e8307db0 100644 --- a/tools/include/linux/kernel.h +++ b/tools/include/linux/kernel.h @@ -92,7 +92,9 @@ int vscnprintf(char *buf, size_t size, const char *fmt, va_list args); int scnprintf(char * buf, size_t size, const char * fmt, ...); int scnprintf_pad(char * buf, size_t size, const char * fmt, ...); +#ifndef ARRAY_SIZE #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr)) +#endif #define current_gfp_context(k) 0 #define synchronize_rcu() diff --git a/tools/testing/selftests/kselftest.h b/tools/testing/selftests/kselftest.h index 8d50483fe204..f1180987492c 100644 --- a/tools/testing/selftests/kselftest.h +++ b/tools/testing/selftests/kselftest.h @@ -48,6 +48,10 @@ #include #include +#ifndef ARRAY_SIZE +#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0])) +#endif + /* define kselftest exit codes */ #define KSFT_PASS 0 #define KSFT_FAIL 1 diff --git a/tools/testing/selftests/kselftest_harness.h b/tools/testing/selftests/kselftest_harness.h index ae0f0f33b2a6..75164e23f036 100644 --- a/tools/testing/selftests/kselftest_harness.h +++ b/tools/testing/selftests/kselftest_harness.h @@ -671,7 +671,9 @@ #define EXPECT_STRNE(expected, seen) \ __EXPECT_STR(expected, seen, !=, 0) +#ifndef ARRAY_SIZE #define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0])) +#endif /* Support an optional handler after and ASSERT_* or EXPECT_*. The approach is * not thread-safe, but it should be fine in most sane test scenarios. From patchwork Fri Dec 10 17:33:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shuah Khan X-Patchwork-Id: 12670457 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 A47F8C433EF for ; Fri, 10 Dec 2021 17:36:20 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id F2EB96B007B; Fri, 10 Dec 2021 12:33:42 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id EDDAD6B007D; Fri, 10 Dec 2021 12:33:42 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DA4FE6B007E; Fri, 10 Dec 2021 12:33:42 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0237.hostedemail.com [216.40.44.237]) by kanga.kvack.org (Postfix) with ESMTP id CCF986B007B for ; Fri, 10 Dec 2021 12:33:42 -0500 (EST) Received: from smtpin11.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 8A2F38540C for ; Fri, 10 Dec 2021 17:33:32 +0000 (UTC) X-FDA: 78902581464.11.0528218 Received: from mail-oi1-f179.google.com (mail-oi1-f179.google.com [209.85.167.179]) by imf13.hostedemail.com (Postfix) with ESMTP id 629C020010 for ; Fri, 10 Dec 2021 17:33:28 +0000 (UTC) Received: by mail-oi1-f179.google.com with SMTP id t19so14208049oij.1 for ; Fri, 10 Dec 2021 09:33:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Om7A8iJx3nmhRt21+GcSVSh1CLYidC/pJOApyfAW7NA=; b=SjV4lPhUdKrmpRTjTbfve+d5B769d3IL84XjeCyYyIxveR1xklcF8EADqlliDHUpYJ Frpg+DqzjkTlT32YzOqef4iMfY3Joj/P40H2wHvWyCUffJ0BIvLT3lAq9spBCpTV9VqW fhqvSvrGrkeHAyMG2Gr2cDT7Go5Db+PPVzNi8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Om7A8iJx3nmhRt21+GcSVSh1CLYidC/pJOApyfAW7NA=; b=7X44tXNRKuArKJ9AFUF3QQLs0f6MWIPLFrc+zlfRMIVWgBO/4inltBfjQm9qatBETU /2rlcP/cL0vuN8RPz1s8TX7IVO+Ayxdun9ORd+cqx8pdm6VmpNHtlUSy2/Tj0XQc+dJv pBfJGLEyGajP7L3EgkY3QjoeJ4RP/8iEQN7pVAWUUiQGK2yA322TpkppYrkd1wUtYrH9 46xZ2VJymiN3KQ4E1dZ0a/IXVq40Cmi8B/q3K1iD3RZM+7UVlJ2wlsbZLvAuVcFQkyQS RUAgjsuSeV/2OVaGe1urUu0nJOOicOMJdY0NpfoVByGoBa4GfS/frU+eEIcXRiXwak6M XymQ== X-Gm-Message-State: AOAM531VtkGnwLPVWEflw4DM0dMBj8dBr+cUwtEe4V5zrOkFen2gq9CO ARR0xOsNA7Fv2SNOBzw76s9AVA== X-Google-Smtp-Source: ABdhPJw1xkTM0IGWbm2xBQvRbX572S/iV1SuoJVNLe1QtOfW6SfMXVYKCvQz8AqfVuAHR9tlpezb4g== X-Received: by 2002:a05:6808:1a02:: with SMTP id bk2mr13567633oib.52.1639157607755; Fri, 10 Dec 2021 09:33:27 -0800 (PST) Received: from shuah-t480s.internal (c-24-9-64-241.hsd1.co.comcast.net. [24.9.64.241]) by smtp.gmail.com with ESMTPSA id x4sm892224oiv.35.2021.12.10.09.33.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Dec 2021 09:33:27 -0800 (PST) From: Shuah Khan To: catalin.marinas@arm.com, will@kernel.org, shuah@kernel.org, keescook@chromium.org, mic@digikod.net, davem@davemloft.net, kuba@kernel.org, peterz@infradead.org, paulmck@kernel.org, boqun.feng@gmail.com, akpm@linux-foundation.org Cc: Shuah Khan , linux-kselftest@vger.kernel.org, linux-security-module@vger.kernel.org, netdev@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 02/12] selftests/arm64: remove ARRAY_SIZE define from vec-syscfg.c Date: Fri, 10 Dec 2021 10:33:12 -0700 Message-Id: <7f6d7252af5c8efda140b6b5f626b9e5a267016a.1639156389.git.skhan@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: References: MIME-Version: 1.0 X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 629C020010 X-Stat-Signature: w4jt63p5uf7iwteeutndfh44wdjm9zm6 Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=linuxfoundation.org header.s=google header.b=SjV4lPhU; spf=pass (imf13.hostedemail.com: domain of skhan@linuxfoundation.org designates 209.85.167.179 as permitted sender) smtp.mailfrom=skhan@linuxfoundation.org; dmarc=pass (policy=none) header.from=linuxfoundation.org X-HE-Tag: 1639157608-904176 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000001, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: ARRAY_SIZE is defined in several selftests. Remove definitions from individual test files and include header file for the define instead. ARRAY_SIZE define is added in a separate patch to prepare for this change. Remove ARRAY_SIZE from vec-syscfg.c and pickup the one defined in kselftest.h. Signed-off-by: Shuah Khan Acked-by: Will Deacon --- tools/testing/selftests/arm64/fp/vec-syscfg.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/tools/testing/selftests/arm64/fp/vec-syscfg.c b/tools/testing/selftests/arm64/fp/vec-syscfg.c index 272b888e018e..c90658811a83 100644 --- a/tools/testing/selftests/arm64/fp/vec-syscfg.c +++ b/tools/testing/selftests/arm64/fp/vec-syscfg.c @@ -21,8 +21,6 @@ #include "../../kselftest.h" #include "rdvl.h" -#define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0])) - #define ARCH_MIN_VL SVE_VL_MIN struct vec_data { From patchwork Fri Dec 10 17:33:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shuah Khan X-Patchwork-Id: 12670451 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 8BB3DC433EF for ; Fri, 10 Dec 2021 17:34:40 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 14D046B0075; Fri, 10 Dec 2021 12:33:42 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 0D4B06B0074; Fri, 10 Dec 2021 12:33:42 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E760C6B007B; Fri, 10 Dec 2021 12:33:41 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0095.hostedemail.com [216.40.44.95]) by kanga.kvack.org (Postfix) with ESMTP id DA9A86B0074 for ; Fri, 10 Dec 2021 12:33:41 -0500 (EST) Received: from smtpin27.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 9485982499B9 for ; Fri, 10 Dec 2021 17:33:31 +0000 (UTC) X-FDA: 78902581422.27.318B46C Received: from mail-ot1-f42.google.com (mail-ot1-f42.google.com [209.85.210.42]) by imf24.hostedemail.com (Postfix) with ESMTP id 44805180015 for ; Fri, 10 Dec 2021 17:33:28 +0000 (UTC) Received: by mail-ot1-f42.google.com with SMTP id 35-20020a9d08a6000000b00579cd5e605eso10394687otf.0 for ; Fri, 10 Dec 2021 09:33:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=gk7892EwBeQtmWfsZIAYujFfNQTmGWtEjgsjRv69+2g=; b=cLDJy7RNXkPVErf7+3pf0+bZ3jiuNMCjfkw3gOiwUaBeQdzuD8ZZ1Uyk7KdyZ6E3xp RKmfI7bq+6mGVljth/QC8Cfr74lIcmqnuNiEg9nlkAeFPl9jwYm93xx09FxNLnzAS3md xU6p7pqzKYbFQQDoiFq/PwNxoFT6afSbfUla4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=gk7892EwBeQtmWfsZIAYujFfNQTmGWtEjgsjRv69+2g=; b=zOw0y7bYpKIts5fQgDmfernIm0h40oiLEqSgrcxzgAsaSnPPGGTcMgE5NjkluXc9Ko 8Bh4BfYmWOYjFcrWha5SC5/H6rIfIdooeTrCw3Y7mh/z830I4eP5m6htwS0+gX05GAtN fw5r2I6pwuEpSrvqedEbpwPMmGphuLFqVEAkprCTKm9Ob/jrIShYMhzKqZ6VnV9ubz5i yZpzL5BJ7JrUBa3tljuCDDuMvVEgptX2wS7ZjKJc1dY7q7PPPQxjS3W+DMZkLuF7PjYS fS4ubcTzPTH1oBSvLjQZoH1qnacr90n7S89hOfuWvSjAeG4Q10YkgUm6O9cEXnMK3h5/ NyPQ== X-Gm-Message-State: AOAM532OknTxZxm/Fh7Av4DJNhGN5RAUBIDZ5Md1hT3KBJMRo4gqcDdz SuiPtNMDKLsG/wG8type3aclFj2lsR5ojw== X-Google-Smtp-Source: ABdhPJy8XksdNtBxn0PbE6EqXjHVZ9t/h8g8/JvDVwy45IUv5fD/F1510mJLv+/gSB4O0/zZ2hb6RA== X-Received: by 2002:a05:6830:4391:: with SMTP id s17mr12125024otv.118.1639157608654; Fri, 10 Dec 2021 09:33:28 -0800 (PST) Received: from shuah-t480s.internal (c-24-9-64-241.hsd1.co.comcast.net. [24.9.64.241]) by smtp.gmail.com with ESMTPSA id x4sm892224oiv.35.2021.12.10.09.33.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Dec 2021 09:33:28 -0800 (PST) From: Shuah Khan To: catalin.marinas@arm.com, will@kernel.org, shuah@kernel.org, keescook@chromium.org, mic@digikod.net, davem@davemloft.net, kuba@kernel.org, peterz@infradead.org, paulmck@kernel.org, boqun.feng@gmail.com, akpm@linux-foundation.org Cc: Shuah Khan , linux-kselftest@vger.kernel.org, linux-security-module@vger.kernel.org, netdev@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 03/12] selftests/cgroup: remove ARRAY_SIZE define from cgroup_util.h Date: Fri, 10 Dec 2021 10:33:13 -0700 Message-Id: <093209c9eb91462a6d9d0080112379c78d18a33c.1639156389.git.skhan@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: References: MIME-Version: 1.0 X-Rspamd-Queue-Id: 44805180015 Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=linuxfoundation.org header.s=google header.b=cLDJy7RN; spf=pass (imf24.hostedemail.com: domain of skhan@linuxfoundation.org designates 209.85.210.42 as permitted sender) smtp.mailfrom=skhan@linuxfoundation.org; dmarc=pass (policy=none) header.from=linuxfoundation.org X-Rspamd-Server: rspam04 X-Stat-Signature: hxmeawc7ikmxdgpkfy7tffjfjw7ugue1 X-HE-Tag: 1639157608-922340 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000361, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: ARRAY_SIZE is defined in several selftests. Remove definitions from individual test files and include header file for the define instead. ARRAY_SIZE define is added in a separate patch to prepare for this change. Remove ARRAY_SIZE from cgroup_util.h and pickup the one defined in kselftest.h. Signed-off-by: Shuah Khan --- tools/testing/selftests/cgroup/cgroup_util.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/cgroup/cgroup_util.h b/tools/testing/selftests/cgroup/cgroup_util.h index 82e59cdf16e7..4f66d10626d2 100644 --- a/tools/testing/selftests/cgroup/cgroup_util.h +++ b/tools/testing/selftests/cgroup/cgroup_util.h @@ -2,9 +2,9 @@ #include #include -#define PAGE_SIZE 4096 +#include "../kselftest.h" -#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0])) +#define PAGE_SIZE 4096 #define MB(x) (x << 20) From patchwork Fri Dec 10 17:33:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shuah Khan X-Patchwork-Id: 12670455 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 0A064C433EF for ; Fri, 10 Dec 2021 17:35:48 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 688AA6B0078; Fri, 10 Dec 2021 12:33:42 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 546E86B007B; Fri, 10 Dec 2021 12:33:42 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3BB176B007E; Fri, 10 Dec 2021 12:33:42 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0233.hostedemail.com [216.40.44.233]) by kanga.kvack.org (Postfix) with ESMTP id 220756B007B for ; Fri, 10 Dec 2021 12:33:42 -0500 (EST) Received: from smtpin31.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id D5F438248D52 for ; Fri, 10 Dec 2021 17:33:31 +0000 (UTC) X-FDA: 78902581422.31.4B47A2E Received: from mail-ot1-f45.google.com (mail-ot1-f45.google.com [209.85.210.45]) by imf05.hostedemail.com (Postfix) with ESMTP id 43855100009 for ; Fri, 10 Dec 2021 17:33:30 +0000 (UTC) Received: by mail-ot1-f45.google.com with SMTP id h19-20020a9d3e53000000b0056547b797b2so10308211otg.4 for ; Fri, 10 Dec 2021 09:33:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=NDgcHDpgiGWK9Ew3NHUhEO9yqNh1ILLLayqUXO2p75w=; b=RBvRuhdbY7g+jhhycOa6s6AnQRPB9u+jMTQAdWAGcbZry4Gs71DzkZXrtyFNlzrjYb t6cYRkjUJNJA0VqVa9VD5NUujJb9jkn5OXNmdw0ZBi1zYANnBFWUCoJvVfZtk5h4sJn1 eqbzyIxoNgJ2evkyeFqyx5i3WODR+TVyV1f2E= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=NDgcHDpgiGWK9Ew3NHUhEO9yqNh1ILLLayqUXO2p75w=; b=WAq5CFAGaX0Zn+0STpZMBwKkGXjlJd1eIg6CUjdfV0bE0X+yNgSNaJoFE0ccHyLPJv 0KbEjTOfydBC9i4mFjhIM5ty9ZGgbnDye3icQbdZWfTM73MtmTdCpmexuE0UlPSu9VAc XBQe2dU6kWvVkuIGlAmfzdUbrN23AOdcyM0MDrK+TUBJJjEZ66X++acUnu7j19VfyGuk OT74fvObzVT0RIERLcTf9YLSZFbaBGnpMJFFdku1cgp5KiMQ4/BZvIPVuwKG+DHhN8db ouqs//Gja7DWAyzuiH1W6Dj69i2I1wqJ2spaVhUnriA6F366nwp8Sfh6k8d5av3gPfB4 6WOQ== X-Gm-Message-State: AOAM531EeJFTJsNiPtLmwNHeYTpeG5PYPlSpLA+Lj3MYsmtwE0J9JUj4 sNyD8094/Cx6ZbcsniKhna59OQ== X-Google-Smtp-Source: ABdhPJyA4yaTBTIyZO1xnTM+/bAUFXSJizFV+09oAtmwLgPNp33uTLG6kCjRdELfrCYBpviWIZftqA== X-Received: by 2002:a05:6830:118a:: with SMTP id u10mr11939448otq.194.1639157609588; Fri, 10 Dec 2021 09:33:29 -0800 (PST) Received: from shuah-t480s.internal (c-24-9-64-241.hsd1.co.comcast.net. [24.9.64.241]) by smtp.gmail.com with ESMTPSA id x4sm892224oiv.35.2021.12.10.09.33.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Dec 2021 09:33:29 -0800 (PST) From: Shuah Khan To: catalin.marinas@arm.com, will@kernel.org, shuah@kernel.org, keescook@chromium.org, mic@digikod.net, davem@davemloft.net, kuba@kernel.org, peterz@infradead.org, paulmck@kernel.org, boqun.feng@gmail.com, akpm@linux-foundation.org Cc: Shuah Khan , linux-kselftest@vger.kernel.org, linux-security-module@vger.kernel.org, netdev@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 04/12] selftests/core: remove ARRAY_SIZE define from close_range_test.c Date: Fri, 10 Dec 2021 10:33:14 -0700 Message-Id: <0b20692e28c83822bb6b56518791371120582d0e.1639156389.git.skhan@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: References: MIME-Version: 1.0 X-Rspamd-Queue-Id: 43855100009 Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=linuxfoundation.org header.s=google header.b=RBvRuhdb; spf=pass (imf05.hostedemail.com: domain of skhan@linuxfoundation.org designates 209.85.210.45 as permitted sender) smtp.mailfrom=skhan@linuxfoundation.org; dmarc=pass (policy=none) header.from=linuxfoundation.org X-Rspamd-Server: rspam04 X-Stat-Signature: 934hdo8em4mnqqfgs99yb7bztnrzt9cp X-HE-Tag: 1639157610-997823 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000004, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: ARRAY_SIZE is defined in several selftests. Remove definitions from individual test files and include header file for the define instead. ARRAY_SIZE define is added in a separate patch to prepare for this change. Remove ARRAY_SIZE from close_range_test.c and pickup the one defined in kselftest.h. Signed-off-by: Shuah Khan --- tools/testing/selftests/core/close_range_test.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tools/testing/selftests/core/close_range_test.c b/tools/testing/selftests/core/close_range_test.c index aa7d13d91963..749239930ca8 100644 --- a/tools/testing/selftests/core/close_range_test.c +++ b/tools/testing/selftests/core/close_range_test.c @@ -50,10 +50,6 @@ static inline int sys_close_range(unsigned int fd, unsigned int max_fd, return syscall(__NR_close_range, fd, max_fd, flags); } -#ifndef ARRAY_SIZE -#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) -#endif - TEST(core_close_range) { int i, ret; From patchwork Fri Dec 10 17:33:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shuah Khan X-Patchwork-Id: 12670453 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 6F1F7C433F5 for ; Fri, 10 Dec 2021 17:35:14 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 45BB46B0074; Fri, 10 Dec 2021 12:33:42 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 399186B0080; Fri, 10 Dec 2021 12:33:42 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 05F6D6B0078; Fri, 10 Dec 2021 12:33:42 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0060.hostedemail.com [216.40.44.60]) by kanga.kvack.org (Postfix) with ESMTP id E4ABA6B0075 for ; Fri, 10 Dec 2021 12:33:41 -0500 (EST) Received: from smtpin25.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 9C4A682DB2 for ; Fri, 10 Dec 2021 17:33:31 +0000 (UTC) X-FDA: 78902581422.25.906FD4A Received: from mail-ot1-f42.google.com (mail-ot1-f42.google.com [209.85.210.42]) by imf21.hostedemail.com (Postfix) with ESMTP id 0C0471C0009 for ; Fri, 10 Dec 2021 17:33:29 +0000 (UTC) Received: by mail-ot1-f42.google.com with SMTP id a23-20020a9d4717000000b0056c15d6d0caso10280456otf.12 for ; Fri, 10 Dec 2021 09:33:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=uh/Z9FDGr3qAAzEx+UXrnnj7QMHTF1v60adwa/WDWsE=; b=QvxE5B8BPn73UwnQSq14JPyQUVNaNUdzJIk09czGGhqGyoNq67Gtxk3CzYxR01hbht xtbSOHY32W87o9On8opuVK6zWIF+ANh7V/TPVN/bXzmOht/nwv8Fe+7n2kGi6lBbGAX0 4aIaRtWSG8tsp1iF8NMv6Vq3Ozl9ooZRMar7o= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=uh/Z9FDGr3qAAzEx+UXrnnj7QMHTF1v60adwa/WDWsE=; b=uJ2OZYojlq4dUmYjCO4kZ4vPxnBJIv6Q2JcjnrDLlxlOJJxLb+BVagEjwv9xdzrgnf LTk+vF2gjSqx4nsa3s/vIsfVanLYhhVrJRYDcJDJgkjqliJgxQc/P8TLi49bPrUzxcWQ j9DHIcNykO/wv605f5E6EghqUruj+qrL78px7EXKLkRNFjJiXWuGCpe26+sfmrXt2EDY EyMeZWvE4QkjXLuo4+Hm0HFZVmswSMd89eP6qQzqtQJ+95XxZ5EnLp3ShVVGxukpMk7K u9db3NpQCmRFro8CGpKqvpKtiyuO5ebwOfnBMivcsrc8qF8Ge5P0v/1sEsvAzYc14N6L gYyQ== X-Gm-Message-State: AOAM531R2plrrC52FTcG/zYTR9D2FLlnTwDpsCGUsvHFZ2SAT1kmxgAI 3M2UcAI3jteFYaQRIm1HE6gADV3sxmAEhQ== X-Google-Smtp-Source: ABdhPJx4YSaRrvZVxbri/pWyy+QD/g1KBhe+XS0kuK/s8ZRC/VWuwyewAD6/3CwmIMT4Ovj4Oe4jIQ== X-Received: by 2002:a9d:8c2:: with SMTP id 60mr12177010otf.174.1639157610565; Fri, 10 Dec 2021 09:33:30 -0800 (PST) Received: from shuah-t480s.internal (c-24-9-64-241.hsd1.co.comcast.net. [24.9.64.241]) by smtp.gmail.com with ESMTPSA id x4sm892224oiv.35.2021.12.10.09.33.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Dec 2021 09:33:30 -0800 (PST) From: Shuah Khan To: catalin.marinas@arm.com, will@kernel.org, shuah@kernel.org, keescook@chromium.org, mic@digikod.net, davem@davemloft.net, kuba@kernel.org, peterz@infradead.org, paulmck@kernel.org, boqun.feng@gmail.com, akpm@linux-foundation.org Cc: Shuah Khan , linux-kselftest@vger.kernel.org, linux-security-module@vger.kernel.org, netdev@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 05/12] selftests/ir: remove ARRAY_SIZE define from ir_loopback.c Date: Fri, 10 Dec 2021 10:33:15 -0700 Message-Id: <019379a12759bf5b3f14cf66c5e8742cc71bced3.1639156389.git.skhan@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: References: MIME-Version: 1.0 X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 0C0471C0009 X-Stat-Signature: q3hfpxpu4a9d9ouztdcmrsryyfptdh6y Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=linuxfoundation.org header.s=google header.b=QvxE5B8B; dmarc=pass (policy=none) header.from=linuxfoundation.org; spf=pass (imf21.hostedemail.com: domain of skhan@linuxfoundation.org designates 209.85.210.42 as permitted sender) smtp.mailfrom=skhan@linuxfoundation.org X-HE-Tag: 1639157609-380493 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000078, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: ARRAY_SIZE is defined in several selftests. Remove definitions from individual test files and include header file for the define instead. ARRAY_SIZE define is added in a separate patch to prepare for this change. Remove ARRAY_SIZE from ir_loopback.c and pickup the one defined in kselftest.h. Signed-off-by: Shuah Khan --- tools/testing/selftests/ir/ir_loopback.c | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/testing/selftests/ir/ir_loopback.c b/tools/testing/selftests/ir/ir_loopback.c index af7f9c7d59bc..06256c96df12 100644 --- a/tools/testing/selftests/ir/ir_loopback.c +++ b/tools/testing/selftests/ir/ir_loopback.c @@ -26,7 +26,6 @@ #include "../kselftest.h" #define TEST_SCANCODES 10 -#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0])) #define SYSFS_PATH_MAX 256 #define DNAME_PATH_MAX 256 From patchwork Fri Dec 10 17:33:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Shuah Khan X-Patchwork-Id: 12670459 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 5D05BC433F5 for ; Fri, 10 Dec 2021 17:36:53 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7DB2F6B007D; Fri, 10 Dec 2021 12:33:43 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 7B2046B007E; Fri, 10 Dec 2021 12:33:43 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 679B56B0080; Fri, 10 Dec 2021 12:33:43 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay040.a.hostedemail.com [64.99.140.40]) by kanga.kvack.org (Postfix) with ESMTP id 5990C6B007D for ; Fri, 10 Dec 2021 12:33:43 -0500 (EST) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 2C08A21CDC for ; Fri, 10 Dec 2021 17:33:33 +0000 (UTC) X-FDA: 78902581506.04.C950A66 Received: from mail-ot1-f52.google.com (mail-ot1-f52.google.com [209.85.210.52]) by imf05.hostedemail.com (Postfix) with ESMTP id B430F100005 for ; Fri, 10 Dec 2021 17:33:32 +0000 (UTC) Received: by mail-ot1-f52.google.com with SMTP id n104-20020a9d2071000000b005799790cf0bso10334853ota.5 for ; Fri, 10 Dec 2021 09:33:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=WMqa61IMKQAN9nayBNaET9ogW/1IQBHwCkgxPK83A3s=; b=ZiinzdUTAUE4pW3+MikJK5J7ul2KgoWPeStbJcIb4f+ObGuAEAF6SL+SMRMxnX95h2 iK95itksi/1uauaJqsD/x6K8C5VGuaLthvLoxR2o9n0klTF4wkcseELo0XrgDCp4GWPa /qWqBFehtViF2vhi7zRNmscMQ1Z5b/aeYT60o= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=WMqa61IMKQAN9nayBNaET9ogW/1IQBHwCkgxPK83A3s=; b=Eq/6zMhc2/Ltjg5UVmSTikuGyG1b64WEiJ5l9qpk/ilp9/xinY2gIunOYRPa/8LMVd SiEgFyOYJeKEFm3sX2v2bTrnn4z6A3oC/nVUGE5kJ/amy9+QQmBK7tk3xdNXy0Sn/NTn 6IZP7GACdC8UeTHqfCE1jo3eNDxrSSmC8bdwQb0GAYk9p4JTvhM2oXOj2j/7LApbpu+p F0OLDGxZx5yOyB3kcRPr8gTxnSDFrQi7u3P/msmNEWiVxkF3sMD5sGWX8//avdJfqy2R XikBvUnhkiku2UlNPaLd0IQuHhkjt5Is19Cz7ysQv+uHdPN8UJfv7xztX11Gr8AIs1Wu RrZw== X-Gm-Message-State: AOAM530gv8D2mteq5X6/TnvkF+0BO8Hs6Q3KSqkMO44scA5Tw2KeCYg8 r03EW1mSmNULXnjXUIPOXLjkFw== X-Google-Smtp-Source: ABdhPJxs5UyjzAwtor6CH4V3zYGHQWLFyg/yw499Ss2tuG45t4WeD25Up32eMNTOXvKpzS2SfYHVjw== X-Received: by 2002:a05:6830:1392:: with SMTP id d18mr11833207otq.374.1639157611625; Fri, 10 Dec 2021 09:33:31 -0800 (PST) Received: from shuah-t480s.internal (c-24-9-64-241.hsd1.co.comcast.net. [24.9.64.241]) by smtp.gmail.com with ESMTPSA id x4sm892224oiv.35.2021.12.10.09.33.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Dec 2021 09:33:31 -0800 (PST) From: Shuah Khan To: catalin.marinas@arm.com, will@kernel.org, shuah@kernel.org, keescook@chromium.org, mic@digikod.net, davem@davemloft.net, kuba@kernel.org, peterz@infradead.org, paulmck@kernel.org, boqun.feng@gmail.com, akpm@linux-foundation.org Cc: Shuah Khan , linux-kselftest@vger.kernel.org, linux-security-module@vger.kernel.org, netdev@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 06/12] selftests/landlock: remove ARRAY_SIZE define from common.h Date: Fri, 10 Dec 2021 10:33:16 -0700 Message-Id: X-Mailer: git-send-email 2.32.0 In-Reply-To: References: MIME-Version: 1.0 X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: B430F100005 X-Stat-Signature: 4d1o7qccis8f6661rinxje7s7fuus3mb Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=linuxfoundation.org header.s=google header.b=ZiinzdUT; dmarc=pass (policy=none) header.from=linuxfoundation.org; spf=pass (imf05.hostedemail.com: domain of skhan@linuxfoundation.org designates 209.85.210.52 as permitted sender) smtp.mailfrom=skhan@linuxfoundation.org X-HE-Tag: 1639157612-80426 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000029, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: ARRAY_SIZE is defined in several selftests. Remove definitions from individual test files and include header file for the define instead. ARRAY_SIZE define is added in a separate patch to prepare for this change. Remove ARRAY_SIZE from common.h and pickup the one defined in kselftest.h. Signed-off-by: Shuah Khan Acked-by: Mickaël Salaün --- tools/testing/selftests/landlock/common.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tools/testing/selftests/landlock/common.h b/tools/testing/selftests/landlock/common.h index 20e2a9286d71..183b7e8e1b95 100644 --- a/tools/testing/selftests/landlock/common.h +++ b/tools/testing/selftests/landlock/common.h @@ -17,10 +17,6 @@ #include "../kselftest_harness.h" -#ifndef ARRAY_SIZE -#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) -#endif - /* * TEST_F_FORK() is useful when a test drop privileges but the corresponding * FIXTURE_TEARDOWN() requires them (e.g. to remove files from a directory From patchwork Fri Dec 10 17:33:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shuah Khan X-Patchwork-Id: 12670461 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 BE02CC433F5 for ; Fri, 10 Dec 2021 17:37:25 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 606D76B007E; Fri, 10 Dec 2021 12:33:44 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 5B6706B0080; Fri, 10 Dec 2021 12:33:44 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 47E636B0081; Fri, 10 Dec 2021 12:33:44 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0190.hostedemail.com [216.40.44.190]) by kanga.kvack.org (Postfix) with ESMTP id 380D76B007E for ; Fri, 10 Dec 2021 12:33:44 -0500 (EST) Received: from smtpin09.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 0467218045D29 for ; Fri, 10 Dec 2021 17:33:34 +0000 (UTC) X-FDA: 78902581548.09.7AF7D19 Received: from mail-ot1-f41.google.com (mail-ot1-f41.google.com [209.85.210.41]) by imf17.hostedemail.com (Postfix) with ESMTP id B4B4240005 for ; Fri, 10 Dec 2021 17:33:30 +0000 (UTC) Received: by mail-ot1-f41.google.com with SMTP id w6-20020a9d77c6000000b0055e804fa524so10335117otl.3 for ; Fri, 10 Dec 2021 09:33:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=/nnwsniEu8uqYxjrwTyGxxsdhf651m9rl/Wv8zBibbw=; b=SmXM3bXqM0gP1T/ezve3OJ9V/UwR0HRmCygo4+nqyzJjP1gF+zR7fge5vblTzlNrCX w04iFxqxd77ZVX79QZ2Zt1uJoQN9tDojIGVstIdl1Ce1fS/SMZQYXDALiC1835irYpPi EhPQEF96/sDzUgJbQgTPDroDn8RrRbvtb3geQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=/nnwsniEu8uqYxjrwTyGxxsdhf651m9rl/Wv8zBibbw=; b=6G0cgh5EQRVj7DHmRlv5qFqM8Utv7DYPiUEh+uvp4TWiFyw+PdZTvQIQ6amwmDGOCp 8cUbVm/VpCnTDCSQb/witukrqsMqkvKhbFMXu11NH7lObcSwQvQt7+M2Htx/eg0h7YLq fRgwsQDtZ3tjn3e8J4WgY6Uhq4Ni+5uWS8AaFRLx7jvw5da13SpqnaGYniwyZpYnkfqC d1/gQy2l+cC7ywyQkblkMzdLoK99006NfUNMaxcv4YY289AswCeSQVXqMIwyEPpgabHA sRFGcknLi7TbVKwge5BFFov/Ly0voClYllNrMVhGuTpFPCamjV/Dtv6vtXaRgNf1WtoH B2cg== X-Gm-Message-State: AOAM530FJRQ5WxD2Wag5JIMQdxvcUP/Lfm7pMbp8TQAHBTnv1HCn9qUf cjNlL+queU/tjvlU4aKDpmCd4w== X-Google-Smtp-Source: ABdhPJw9KMAr8iR7/gO1NKMOwvgOgpBIMplkuY0P/9SLX80+FALZ7l62v8z8IlRFbsoMk0FcxwUIOQ== X-Received: by 2002:a9d:ea6:: with SMTP id 35mr11764702otj.304.1639157612590; Fri, 10 Dec 2021 09:33:32 -0800 (PST) Received: from shuah-t480s.internal (c-24-9-64-241.hsd1.co.comcast.net. [24.9.64.241]) by smtp.gmail.com with ESMTPSA id x4sm892224oiv.35.2021.12.10.09.33.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Dec 2021 09:33:32 -0800 (PST) From: Shuah Khan To: catalin.marinas@arm.com, will@kernel.org, shuah@kernel.org, keescook@chromium.org, mic@digikod.net, davem@davemloft.net, kuba@kernel.org, peterz@infradead.org, paulmck@kernel.org, boqun.feng@gmail.com, akpm@linux-foundation.org Cc: Shuah Khan , linux-kselftest@vger.kernel.org, linux-security-module@vger.kernel.org, netdev@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 07/12] selftests/net: remove ARRAY_SIZE define from individual tests Date: Fri, 10 Dec 2021 10:33:17 -0700 Message-Id: <1356c830b8155ddd37a6330c1f5d4df7a1bdb86a.1639156389.git.skhan@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: References: MIME-Version: 1.0 X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: B4B4240005 X-Stat-Signature: aarikz1mre3bkkwpct1ko47nfiqyangw Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=linuxfoundation.org header.s=google header.b=SmXM3bXq; dmarc=pass (policy=none) header.from=linuxfoundation.org; spf=pass (imf17.hostedemail.com: domain of skhan@linuxfoundation.org designates 209.85.210.41 as permitted sender) smtp.mailfrom=skhan@linuxfoundation.org X-HE-Tag: 1639157610-21898 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: ARRAY_SIZE is defined in several selftests. Remove definitions from individual test files and include header file for the define instead. ARRAY_SIZE define is added in a separate patch to prepare for this change. Remove ARRAY_SIZE from net tests and pickup the one defined in kselftest.h. Signed-off-by: Shuah Khan Acked-by: Jakub Kicinski --- tools/testing/selftests/net/gro.c | 3 ++- tools/testing/selftests/net/ipsec.c | 1 - tools/testing/selftests/net/reuseport_bpf.c | 4 +--- tools/testing/selftests/net/rxtimestamp.c | 2 +- tools/testing/selftests/net/socket.c | 3 ++- tools/testing/selftests/net/tcp_fastopen_backup_key.c | 6 ++---- 6 files changed, 8 insertions(+), 11 deletions(-) diff --git a/tools/testing/selftests/net/gro.c b/tools/testing/selftests/net/gro.c index cf37ce86b0fd..221525ccbe1d 100644 --- a/tools/testing/selftests/net/gro.c +++ b/tools/testing/selftests/net/gro.c @@ -57,10 +57,11 @@ #include #include +#include "../kselftest.h" + #define DPORT 8000 #define SPORT 1500 #define PAYLOAD_LEN 100 -#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0])) #define NUM_PACKETS 4 #define START_SEQ 100 #define START_ACK 100 diff --git a/tools/testing/selftests/net/ipsec.c b/tools/testing/selftests/net/ipsec.c index 3d7dde2c321b..cc10c10c5ed9 100644 --- a/tools/testing/selftests/net/ipsec.c +++ b/tools/testing/selftests/net/ipsec.c @@ -41,7 +41,6 @@ #define pr_err(fmt, ...) printk(fmt ": %m", ##__VA_ARGS__) -#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0])) #define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)])) #define IPV4_STR_SZ 16 /* xxx.xxx.xxx.xxx is longest + \0 */ diff --git a/tools/testing/selftests/net/reuseport_bpf.c b/tools/testing/selftests/net/reuseport_bpf.c index b5277106df1f..072d709c96b4 100644 --- a/tools/testing/selftests/net/reuseport_bpf.c +++ b/tools/testing/selftests/net/reuseport_bpf.c @@ -24,9 +24,7 @@ #include #include -#ifndef ARRAY_SIZE -#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0])) -#endif +#include "../kselftest.h" struct test_params { int recv_family; diff --git a/tools/testing/selftests/net/rxtimestamp.c b/tools/testing/selftests/net/rxtimestamp.c index e4613ce4ed69..9eb42570294d 100644 --- a/tools/testing/selftests/net/rxtimestamp.c +++ b/tools/testing/selftests/net/rxtimestamp.c @@ -18,7 +18,7 @@ #include #include -#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0])) +#include "../kselftest.h" struct options { int so_timestamp; diff --git a/tools/testing/selftests/net/socket.c b/tools/testing/selftests/net/socket.c index afca1ead677f..db1aeb8c5d1e 100644 --- a/tools/testing/selftests/net/socket.c +++ b/tools/testing/selftests/net/socket.c @@ -7,6 +7,8 @@ #include #include +#include "../kselftest.h" + struct socket_testcase { int domain; int type; @@ -31,7 +33,6 @@ static struct socket_testcase tests[] = { { AF_INET, SOCK_STREAM, IPPROTO_UDP, -EPROTONOSUPPORT, 1 }, }; -#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0])) #define ERR_STRING_SZ 64 static int run_tests(void) diff --git a/tools/testing/selftests/net/tcp_fastopen_backup_key.c b/tools/testing/selftests/net/tcp_fastopen_backup_key.c index 9c55ec44fc43..c1cb0c75156a 100644 --- a/tools/testing/selftests/net/tcp_fastopen_backup_key.c +++ b/tools/testing/selftests/net/tcp_fastopen_backup_key.c @@ -26,6 +26,8 @@ #include #include +#include "../kselftest.h" + #ifndef TCP_FASTOPEN_KEY #define TCP_FASTOPEN_KEY 33 #endif @@ -34,10 +36,6 @@ #define PROC_FASTOPEN_KEY "/proc/sys/net/ipv4/tcp_fastopen_key" #define KEY_LENGTH 16 -#ifndef ARRAY_SIZE -#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0])) -#endif - static bool do_ipv6; static bool do_sockopt; static bool do_rotate; From patchwork Fri Dec 10 17:33:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shuah Khan X-Patchwork-Id: 12670463 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 B9833C433FE for ; Fri, 10 Dec 2021 17:37:58 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A738D6B0080; Fri, 10 Dec 2021 12:33:45 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A23B46B0081; Fri, 10 Dec 2021 12:33:45 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8EB386B0082; Fri, 10 Dec 2021 12:33:45 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay025.a.hostedemail.com [64.99.140.25]) by kanga.kvack.org (Postfix) with ESMTP id 80D396B0080 for ; Fri, 10 Dec 2021 12:33:45 -0500 (EST) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay11.hostedemail.com (Postfix) with ESMTP id 5E0608049A for ; Fri, 10 Dec 2021 17:33:35 +0000 (UTC) X-FDA: 78902581590.01.EF18537 Received: from mail-ot1-f47.google.com (mail-ot1-f47.google.com [209.85.210.47]) by imf25.hostedemail.com (Postfix) with ESMTP id D39DCA000F for ; Fri, 10 Dec 2021 17:33:32 +0000 (UTC) Received: by mail-ot1-f47.google.com with SMTP id v15-20020a9d604f000000b0056cdb373b82so10321231otj.7 for ; Fri, 10 Dec 2021 09:33:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=4WzsD+UFVzLiH0Fp9HCyUMze55/PXfN1Fv5h1c0wwoc=; b=Qchokgi1K6EjNENIB16rZTHkLbnhJuZXljqbd4G55iiZmPcNdBVkeVbMowdmC9q4qj uM+vvJsP1r/+NUFhjZ04YGOlvj7dYAlIu5fXxMAi7Vp8riHsOdb9yTNfCIZhxOzmilUN fYlr3CYWkIhW0u0R7l+00dYGvA8bO+xcWIlrg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=4WzsD+UFVzLiH0Fp9HCyUMze55/PXfN1Fv5h1c0wwoc=; b=TIgjnTOa9DdtIqk9wIviEhzssAq7Hab3iYuI5F7DsPt+5/04kDnnrXI+Vqn3q5otTh wXKEDMUpzPFQd4MyqmgzXKuORC61MI3VQ0v+1bT9X49nRPbw6w9n04IU2fICEskc0E5q 3ZWbaQzuotV04bdj/rBGCBpr7GKqKZ8tq6Z2WU4XazV6uRd3o3s/P2nq9DJEesETuEig zxNwOWoMeALW8iVUZ5JXiAcpxTEF+jDUNnN1L80aepcOUZJPC6F4JZWy+3tqVNFBrl+7 Ib3e3rp6LYD9GgV8VmISoBohlSlEGkYKSJgHu9YxERULsawb4trKO1CI1maXN6fzrLuC Cefg== X-Gm-Message-State: AOAM530GbKARX3Rsyd5BfQjRPtmRCPyIrrCZuQixm7FKLYApyuIGqQj0 +qaZvvv/fI4mc75/+Neun43yLA== X-Google-Smtp-Source: ABdhPJyxsZn85HCQXDC0NYZWNPCIdku6oxp+hW2STbG5C8HyB1dqb+FYA6EOrK7FlkRbQQsZUFS6ug== X-Received: by 2002:a9d:373:: with SMTP id 106mr12125638otv.127.1639157613531; Fri, 10 Dec 2021 09:33:33 -0800 (PST) Received: from shuah-t480s.internal (c-24-9-64-241.hsd1.co.comcast.net. [24.9.64.241]) by smtp.gmail.com with ESMTPSA id x4sm892224oiv.35.2021.12.10.09.33.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Dec 2021 09:33:33 -0800 (PST) From: Shuah Khan To: catalin.marinas@arm.com, will@kernel.org, shuah@kernel.org, keescook@chromium.org, mic@digikod.net, davem@davemloft.net, kuba@kernel.org, peterz@infradead.org, paulmck@kernel.org, boqun.feng@gmail.com, akpm@linux-foundation.org Cc: Shuah Khan , linux-kselftest@vger.kernel.org, linux-security-module@vger.kernel.org, netdev@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 08/12] selftests/rseq: remove ARRAY_SIZE define from individual tests Date: Fri, 10 Dec 2021 10:33:18 -0700 Message-Id: X-Mailer: git-send-email 2.32.0 In-Reply-To: References: MIME-Version: 1.0 X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: D39DCA000F X-Stat-Signature: ahqqcsdtueiatx7d4bkyksr7bkx96ces Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=linuxfoundation.org header.s=google header.b=Qchokgi1; dmarc=pass (policy=none) header.from=linuxfoundation.org; spf=pass (imf25.hostedemail.com: domain of skhan@linuxfoundation.org designates 209.85.210.47 as permitted sender) smtp.mailfrom=skhan@linuxfoundation.org X-HE-Tag: 1639157612-116700 X-Bogosity: Ham, tests=bogofilter, spamicity=0.003414, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: ARRAY_SIZE is defined in several selftests. Remove definitions from individual test files and include header file for the define instead. ARRAY_SIZE define is added in a separate patch to prepare for this change. Remove ARRAY_SIZE from rseq tests and pickup the one defined in kselftest.h. Signed-off-by: Shuah Khan --- tools/testing/selftests/rseq/basic_percpu_ops_test.c | 3 +-- tools/testing/selftests/rseq/rseq.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/tools/testing/selftests/rseq/basic_percpu_ops_test.c b/tools/testing/selftests/rseq/basic_percpu_ops_test.c index eb3f6db36d36..b953a52ff706 100644 --- a/tools/testing/selftests/rseq/basic_percpu_ops_test.c +++ b/tools/testing/selftests/rseq/basic_percpu_ops_test.c @@ -9,10 +9,9 @@ #include #include +#include "../kselftest.h" #include "rseq.h" -#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0])) - struct percpu_lock_entry { intptr_t v; } __attribute__((aligned(128))); diff --git a/tools/testing/selftests/rseq/rseq.c b/tools/testing/selftests/rseq/rseq.c index 7159eb777fd3..fb440dfca158 100644 --- a/tools/testing/selftests/rseq/rseq.c +++ b/tools/testing/selftests/rseq/rseq.c @@ -27,10 +27,9 @@ #include #include +#include "../kselftest.h" #include "rseq.h" -#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0])) - __thread volatile struct rseq __rseq_abi = { .cpu_id = RSEQ_CPU_ID_UNINITIALIZED, }; From patchwork Fri Dec 10 17:33:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shuah Khan X-Patchwork-Id: 12670465 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 16C3BC433F5 for ; Fri, 10 Dec 2021 17:38:31 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 40AEA6B0081; Fri, 10 Dec 2021 12:33:46 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 3BB786B0082; Fri, 10 Dec 2021 12:33:46 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2A9136B0083; Fri, 10 Dec 2021 12:33:46 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0218.hostedemail.com [216.40.44.218]) by kanga.kvack.org (Postfix) with ESMTP id 1ADEC6B0081 for ; Fri, 10 Dec 2021 12:33:46 -0500 (EST) Received: from smtpin15.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id D1D7E82FD7 for ; Fri, 10 Dec 2021 17:33:35 +0000 (UTC) X-FDA: 78902581590.15.8BDF0F6 Received: from mail-ot1-f46.google.com (mail-ot1-f46.google.com [209.85.210.46]) by imf06.hostedemail.com (Postfix) with ESMTP id 83DA4180012 for ; Fri, 10 Dec 2021 17:33:34 +0000 (UTC) Received: by mail-ot1-f46.google.com with SMTP id h19-20020a9d3e53000000b0056547b797b2so10308419otg.4 for ; Fri, 10 Dec 2021 09:33:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Ol2LYejDODLNDCE9czeVtY6ZXvOj8cq9Dfk6NPWHsZY=; b=HBUNCaPvhfUaNQMquE8OUfIRrgmyX82ibPWw02Ng8pu7UyIZi6ZN6ze3wHpalVRLq8 CruwY2I6pMfj2zKyYebS6zyfpAu0zAI0d0VcLZdnKAbaQdFIPrJT+/hLE+aMawAK6euu TsIJst1MmQSizYM3Y4pSmGaUHMkpUbyfEJ0k0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Ol2LYejDODLNDCE9czeVtY6ZXvOj8cq9Dfk6NPWHsZY=; b=bxTxoRb8kXiwg6VFz+i7fWGuCg/5+WPN60yvaYLBSIJd9R7NTLZ53rRuQH4cXUn1Z+ NG3k8SKZakAhbLlv0LUKRRUlo0u95LKsBppyIABRvrQ2VVuJfc5YplcCi8wMBWEQUoVW lHJEMJ9JlIAW5p1z6W0/kMowYj7yHrKjeD8i0Q0/IpLu6tdMnLbUEFDS3BV9lKu0Nzq3 BSYvciavqc1t6DXrvTzsrYwxcEhPjdpGt5hRFO3jd6d+8dW+cEIfYW8TJ+45vJKRHAuY WeZtBDmQ4YVH9e+EO1FjJGybmXavbeT6Ns5jZuqJOZU/DHYG5E/ODcXUwjNJHcXRC9gh KRzA== X-Gm-Message-State: AOAM531BqlVrLpRl9Sv+kJjHI6pr1IaDH1zshnlt/i9GHJdQDp8exrgT 9W+l7P/sP+19+wzY/OrcAdOMWA== X-Google-Smtp-Source: ABdhPJwC08jHpPh4Q3noN8ttIxOYmu22m0CTuK9V/wHlRnKrp4RkdnmVkknN/jUdmXkq6G6Ycz5roA== X-Received: by 2002:a05:6830:3094:: with SMTP id f20mr12233166ots.201.1639157614456; Fri, 10 Dec 2021 09:33:34 -0800 (PST) Received: from shuah-t480s.internal (c-24-9-64-241.hsd1.co.comcast.net. [24.9.64.241]) by smtp.gmail.com with ESMTPSA id x4sm892224oiv.35.2021.12.10.09.33.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Dec 2021 09:33:34 -0800 (PST) From: Shuah Khan To: catalin.marinas@arm.com, will@kernel.org, shuah@kernel.org, keescook@chromium.org, mic@digikod.net, davem@davemloft.net, kuba@kernel.org, peterz@infradead.org, paulmck@kernel.org, boqun.feng@gmail.com, akpm@linux-foundation.org Cc: Shuah Khan , linux-kselftest@vger.kernel.org, linux-security-module@vger.kernel.org, netdev@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 09/12] selftests/seccomp: remove ARRAY_SIZE define from seccomp_benchmark Date: Fri, 10 Dec 2021 10:33:19 -0700 Message-Id: <80fa7078e0645649b6e31be4844a3cffbe67a79b.1639156389.git.skhan@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: References: MIME-Version: 1.0 Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=linuxfoundation.org header.s=google header.b=HBUNCaPv; dmarc=pass (policy=none) header.from=linuxfoundation.org; spf=pass (imf06.hostedemail.com: domain of skhan@linuxfoundation.org designates 209.85.210.46 as permitted sender) smtp.mailfrom=skhan@linuxfoundation.org X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 83DA4180012 X-Stat-Signature: 8m17ktywujrfh1zsezccc46d4xip67dd X-HE-Tag: 1639157614-917592 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: ARRAY_SIZE is defined in several selftests. Remove definitions from individual test files and include header file for the define instead. ARRAY_SIZE define is added in a separate patch to prepare for this change. Remove ARRAY_SIZE from seccomp_benchmark and pickup the one defined in kselftest.h. Signed-off-by: Shuah Khan Reviewed-by: Kees Cook --- tools/testing/selftests/seccomp/seccomp_benchmark.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/seccomp/seccomp_benchmark.c b/tools/testing/selftests/seccomp/seccomp_benchmark.c index 6e5102a7d7c9..5b5c9d558dee 100644 --- a/tools/testing/selftests/seccomp/seccomp_benchmark.c +++ b/tools/testing/selftests/seccomp/seccomp_benchmark.c @@ -18,7 +18,7 @@ #include #include -#define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0])) +#include "../kselftest.h" unsigned long long timing(clockid_t clk_id, unsigned long long samples) { From patchwork Fri Dec 10 17:33:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shuah Khan X-Patchwork-Id: 12670481 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 56131C433F5 for ; Fri, 10 Dec 2021 17:39:37 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 25F306B0083; Fri, 10 Dec 2021 12:33:49 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 1E5516B0085; Fri, 10 Dec 2021 12:33:49 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 038006B0089; Fri, 10 Dec 2021 12:33:49 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0058.hostedemail.com [216.40.44.58]) by kanga.kvack.org (Postfix) with ESMTP id DE2C36B0085 for ; Fri, 10 Dec 2021 12:33:48 -0500 (EST) Received: from smtpin19.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 8E86A8249980 for ; Fri, 10 Dec 2021 17:33:38 +0000 (UTC) X-FDA: 78902581716.19.E2D6810 Received: from mail-ot1-f53.google.com (mail-ot1-f53.google.com [209.85.210.53]) by imf14.hostedemail.com (Postfix) with ESMTP id 06D3E100021 for ; Fri, 10 Dec 2021 17:33:34 +0000 (UTC) Received: by mail-ot1-f53.google.com with SMTP id x3-20020a05683000c300b0057a5318c517so10257624oto.13 for ; Fri, 10 Dec 2021 09:33:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=l/J3xxEJxkEvAAiRy+g/i0IsA4cENLPTzNbNRnvQozU=; b=MO5T+UaVz8ug6bW9OaRnZMX373bpG+BInMrxZgZYu0IMhZklmmEfDKCyN/K2MoiODa G6hO3uQZa9blhM3SlfDIt7aLnyMgJDl58ZaCKTgRJS1BUllpVaSen47Y590oxNA+YWox 87Qo100HIDOoVJD0mJaPMQpUlA9+yPM0r9/9k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=l/J3xxEJxkEvAAiRy+g/i0IsA4cENLPTzNbNRnvQozU=; b=BJ1Mp3y6CiAScGUtW/wBUAz/p9OEOD+oOuyhseUOI7o0eWsMEOQBo3Vp4nvp9b9BUt jaLGovAOnN5aC09x61ig20LtGPXDAQC8/X3u/HgBak+Sn+EnJrzlZNz+ds8lPewgf95w aeGw55L+e0SrzrktvMex/nlca/1oAXRc6leVNcNG25QX4ZLh5EAxO385v411DTRWAnML ZtJv1yff8Ksyv6FHHG8Y4dj1aCU17wJxWlqQQg+W/Ou87kBlzi0fQ47nfpdeBdFKAuXq Ktwgj8Gz4DEzfAZH8o13uNu4R3XxsbphFJaLRwf7ditIoZ9BSQXdStW/NQpUKvFZIgvi zoxQ== X-Gm-Message-State: AOAM532MSGVp7PBhTHeChFKvDFhC6E3bY4eckLhVSrJl9pSHNiw6otmh YTrwK1tdBpqqZDwHgzE8JKG44A== X-Google-Smtp-Source: ABdhPJyBok/xLU4m7kmNcpabZivXV4eEhLTbuaMZiVGExFqxo43MXq9in4SCZUd7RRqOP++fZsAALA== X-Received: by 2002:a9d:7993:: with SMTP id h19mr12393753otm.245.1639157615401; Fri, 10 Dec 2021 09:33:35 -0800 (PST) Received: from shuah-t480s.internal (c-24-9-64-241.hsd1.co.comcast.net. [24.9.64.241]) by smtp.gmail.com with ESMTPSA id x4sm892224oiv.35.2021.12.10.09.33.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Dec 2021 09:33:35 -0800 (PST) From: Shuah Khan To: catalin.marinas@arm.com, will@kernel.org, shuah@kernel.org, keescook@chromium.org, mic@digikod.net, davem@davemloft.net, kuba@kernel.org, peterz@infradead.org, paulmck@kernel.org, boqun.feng@gmail.com, akpm@linux-foundation.org Cc: Shuah Khan , linux-kselftest@vger.kernel.org, linux-security-module@vger.kernel.org, netdev@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 10/12] selftests/sparc64: remove ARRAY_SIZE define from adi-test Date: Fri, 10 Dec 2021 10:33:20 -0700 Message-Id: <1d59b5b24a98ffbc83de257c1a9cbe1fd9f01c63.1639156389.git.skhan@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: References: MIME-Version: 1.0 X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 06D3E100021 X-Stat-Signature: jfx8k4aq8ig4raa5ci8cqotmrpshazfu Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=linuxfoundation.org header.s=google header.b=MO5T+UaV; dmarc=pass (policy=none) header.from=linuxfoundation.org; spf=pass (imf14.hostedemail.com: domain of skhan@linuxfoundation.org designates 209.85.210.53 as permitted sender) smtp.mailfrom=skhan@linuxfoundation.org X-HE-Tag: 1639157614-399245 X-Bogosity: Ham, tests=bogofilter, spamicity=0.003531, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: ARRAY_SIZE is defined in several selftests. Remove definition from individual test files and include header file for the define instead. ARRAY_SIZE define is added in a separate patch to prepare for this change. Remove ARRAY_SIZE from adi-test and pickup the one defined in kselftest.h. Signed-off-by: Shuah Khan --- tools/testing/selftests/sparc64/drivers/adi-test.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tools/testing/selftests/sparc64/drivers/adi-test.c b/tools/testing/selftests/sparc64/drivers/adi-test.c index 95d93c6a88a5..84e5d9fd20b0 100644 --- a/tools/testing/selftests/sparc64/drivers/adi-test.c +++ b/tools/testing/selftests/sparc64/drivers/adi-test.c @@ -24,10 +24,6 @@ #define DEBUG_LEVEL_4_BIT (0x0008) #define DEBUG_TIMING_BIT (0x1000) -#ifndef ARRAY_SIZE -# define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) -#endif - /* bit mask of enabled bits to print */ #define DEBUG 0x0001 From patchwork Fri Dec 10 17:33:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shuah Khan X-Patchwork-Id: 12670467 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 609C2C433F5 for ; Fri, 10 Dec 2021 17:39:04 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D80D36B0082; Fri, 10 Dec 2021 12:33:48 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id D30AF6B0083; Fri, 10 Dec 2021 12:33:48 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BD19E6B0085; Fri, 10 Dec 2021 12:33:48 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0110.hostedemail.com [216.40.44.110]) by kanga.kvack.org (Postfix) with ESMTP id AF4E96B0082 for ; Fri, 10 Dec 2021 12:33:48 -0500 (EST) Received: from smtpin31.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 76C38181AF5EA for ; Fri, 10 Dec 2021 17:33:38 +0000 (UTC) X-FDA: 78902581716.31.DF6583B Received: from mail-ot1-f50.google.com (mail-ot1-f50.google.com [209.85.210.50]) by imf05.hostedemail.com (Postfix) with ESMTP id D34AB100005 for ; Fri, 10 Dec 2021 17:33:37 +0000 (UTC) Received: by mail-ot1-f50.google.com with SMTP id x3-20020a05683000c300b0057a5318c517so10257675oto.13 for ; Fri, 10 Dec 2021 09:33:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=DiZeUVUX8yxJeM10Cpt7v1VvqmpI5eFmoRBxYdddIiM=; b=K0OpNOeDoVajb3W4xt0KX7FV9FbcaAXSxNvrA6087bIQw7tap5Xv3ErI4wfxiVZEYz M6AfFqilfX8ijAknnwuE2KW46iOXBC7rxJrpuL1JwcedYnpdXUvl2dp2O008xrVpHkp/ 0+YC6YtffxgVuZdSYs9NfFLK09hxHT0eSo2gM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=DiZeUVUX8yxJeM10Cpt7v1VvqmpI5eFmoRBxYdddIiM=; b=KInuZDa00emigmPlxcDgAO9t6ad+5IhMsNMvONN5d8ULYwMwISHLeCciIgw9niedRE Rvy5eIKS0b+lWPafQKYbS8QWFzgzoi8+GiI5we2PnM3mzB0voDW4Nlvc9dHexZFFPWd4 BkIADil+kN6Icz3XwXAZsirAa++rhlyvbHpa7G31Kgzxsva67L1gx7cAAbTZClltdBqO Uywv3xWacVQBYYor+0SZS1L4kyUBnh2E21bRIWAMsk+xjXmP1wfn5XdZ3GzWCrDfsrxv e+IhLGjecmdc5+QCwtuuoBHl/wxE6ek4YeDbnvap0fS4daxbGtKRNy1HNZMmz1Yw2o8Q PMsA== X-Gm-Message-State: AOAM533BEBhk7Sp+hxLvWXQNYttfsFOYjfQ6B8ZDxf/8w3esIFtWJQDt 5ilRTc7F+n/qnEML7rsG2O5dTg== X-Google-Smtp-Source: ABdhPJwjEnwr1b7d/xDdJEMULYxeBIxDwb3X/wQaHnBiudTS3BTD6SqME8GwsDGoPjchyNdPyOCytA== X-Received: by 2002:a05:6830:1e4a:: with SMTP id e10mr12001687otj.58.1639157616590; Fri, 10 Dec 2021 09:33:36 -0800 (PST) Received: from shuah-t480s.internal (c-24-9-64-241.hsd1.co.comcast.net. [24.9.64.241]) by smtp.gmail.com with ESMTPSA id x4sm892224oiv.35.2021.12.10.09.33.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Dec 2021 09:33:36 -0800 (PST) From: Shuah Khan To: catalin.marinas@arm.com, will@kernel.org, shuah@kernel.org, keescook@chromium.org, mic@digikod.net, davem@davemloft.net, kuba@kernel.org, peterz@infradead.org, paulmck@kernel.org, boqun.feng@gmail.com, akpm@linux-foundation.org Cc: Shuah Khan , linux-kselftest@vger.kernel.org, linux-security-module@vger.kernel.org, netdev@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 11/12] selftests/timens: remove ARRAY_SIZE define from individual tests Date: Fri, 10 Dec 2021 10:33:21 -0700 Message-Id: <5837749541102ed658cfae6ab4b68be9f7f96688.1639156389.git.skhan@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: References: MIME-Version: 1.0 X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: D34AB100005 X-Stat-Signature: bpjq8fbd81ajz9y1p38ddmsob6z55pn5 Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=linuxfoundation.org header.s=google header.b=K0OpNOeD; spf=pass (imf05.hostedemail.com: domain of skhan@linuxfoundation.org designates 209.85.210.50 as permitted sender) smtp.mailfrom=skhan@linuxfoundation.org; dmarc=pass (policy=none) header.from=linuxfoundation.org X-HE-Tag: 1639157617-553046 X-Bogosity: Ham, tests=bogofilter, spamicity=0.047613, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: ARRAY_SIZE is defined in several selftests. Remove definitions from individual test files and include header file for the define instead. ARRAY_SIZE define is added in a separate patch to prepare for this change. Remove ARRAY_SIZE from timens tests and pickup the one defined in kselftest.h. Signed-off-by: Shuah Khan --- tools/testing/selftests/timens/procfs.c | 2 -- tools/testing/selftests/timens/timens.c | 2 -- 2 files changed, 4 deletions(-) diff --git a/tools/testing/selftests/timens/procfs.c b/tools/testing/selftests/timens/procfs.c index f2519154208a..1833ca97eb24 100644 --- a/tools/testing/selftests/timens/procfs.c +++ b/tools/testing/selftests/timens/procfs.c @@ -24,8 +24,6 @@ #define DAY_IN_SEC (60*60*24) #define TEN_DAYS_IN_SEC (10*DAY_IN_SEC) -#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0])) - static int child_ns, parent_ns; static int switch_ns(int fd) diff --git a/tools/testing/selftests/timens/timens.c b/tools/testing/selftests/timens/timens.c index 52b6a1185f52..387220791a05 100644 --- a/tools/testing/selftests/timens/timens.c +++ b/tools/testing/selftests/timens/timens.c @@ -22,8 +22,6 @@ #define DAY_IN_SEC (60*60*24) #define TEN_DAYS_IN_SEC (10*DAY_IN_SEC) -#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0])) - struct test_clock { clockid_t id; char *name; From patchwork Fri Dec 10 17:33:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shuah Khan X-Patchwork-Id: 12670483 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 35F90C433EF for ; Fri, 10 Dec 2021 17:40:10 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4B4346B0085; Fri, 10 Dec 2021 12:33:49 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 3BD306B0089; Fri, 10 Dec 2021 12:33:49 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1989E6B0088; Fri, 10 Dec 2021 12:33:49 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0144.hostedemail.com [216.40.44.144]) by kanga.kvack.org (Postfix) with ESMTP id F400D6B0087 for ; Fri, 10 Dec 2021 12:33:48 -0500 (EST) Received: from smtpin19.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id B015689565 for ; Fri, 10 Dec 2021 17:33:38 +0000 (UTC) X-FDA: 78902581716.19.89D7189 Received: from mail-ot1-f44.google.com (mail-ot1-f44.google.com [209.85.210.44]) by imf09.hostedemail.com (Postfix) with ESMTP id A016814000B for ; Fri, 10 Dec 2021 17:33:36 +0000 (UTC) Received: by mail-ot1-f44.google.com with SMTP id x43-20020a056830246b00b00570d09d34ebso10345396otr.2 for ; Fri, 10 Dec 2021 09:33:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=z8DvdE8cQs/ahPWAnUud5n5yToq2pjtImEbhrWCSKj4=; b=A2U4egVLtJIpoFQ30tstUVGzUGtOmsoHZ0xs8fseV5579Sz4E00j5WbNj12yVBrh10 gBjWd+OSjLozqsC67VnD+TKT5lsMslmI9Dan2YNX0NvXY97ryAY1BHSC/uJesx1iBcpC Pd1bwFa6CQTZ3aeMIGkPxRo3I016VxH2gMgzU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=z8DvdE8cQs/ahPWAnUud5n5yToq2pjtImEbhrWCSKj4=; b=z/ZBXWJw9ow4Glmq5UL8WGUG5cBUGu92c4YbH/p/fxYs8dBwkEdwhBT14iIrQqxOgD fAQThr9CmJC+opTbZ1JHYi8CPl0mU0TlUK0ykGmLdOZeCpaAq7bGXChf+Y5PWKgIu7+h 4sTX/miXuH4d0NfteBlNyUb5Bs5bAHFAjs7orHcT2Rx+DuC2Jxm9MFa0AsamEHcY+UVz jBPvH6ugmdV9txQnpX0aTbEVrekVjbODI6WA4hIfMDX2ZiDG9y/gaxLOfgNQJOPBFCLz /B/+pwltogbEIddRI2Rjwc4FnfFOiSw1pHSkT/8EUVzH3r81H/k1y6yyTDxFApDkqyA2 1NIw== X-Gm-Message-State: AOAM531+DRSj+f5eho9aZ2SYPJMbk4zh1DnZHxyStdLBBBNxfivu9ku1 HWv7z3GtlwY/20lbA78uVACE9Q== X-Google-Smtp-Source: ABdhPJw/EV9rFIsA/Y2l9EL9YhWZjVYVklXozZh2QN5jLKH28l9K6PLS2YIbrdvs6ptrFP99TR5idg== X-Received: by 2002:a05:6830:1216:: with SMTP id r22mr12680706otp.10.1639157617637; Fri, 10 Dec 2021 09:33:37 -0800 (PST) Received: from shuah-t480s.internal (c-24-9-64-241.hsd1.co.comcast.net. [24.9.64.241]) by smtp.gmail.com with ESMTPSA id x4sm892224oiv.35.2021.12.10.09.33.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Dec 2021 09:33:37 -0800 (PST) From: Shuah Khan To: catalin.marinas@arm.com, will@kernel.org, shuah@kernel.org, keescook@chromium.org, mic@digikod.net, davem@davemloft.net, kuba@kernel.org, peterz@infradead.org, paulmck@kernel.org, boqun.feng@gmail.com, akpm@linux-foundation.org Cc: Shuah Khan , linux-kselftest@vger.kernel.org, linux-security-module@vger.kernel.org, netdev@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 12/12] selftests/vm: remove ARRAY_SIZE define from individual tests Date: Fri, 10 Dec 2021 10:33:22 -0700 Message-Id: <18321f68b399cd2c2709131d6d6eb1d0f58e8b4f.1639156389.git.skhan@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: References: MIME-Version: 1.0 X-Stat-Signature: qdjxbz67bkwznd514h3umhigzijajhsc Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=linuxfoundation.org header.s=google header.b=A2U4egVL; spf=pass (imf09.hostedemail.com: domain of skhan@linuxfoundation.org designates 209.85.210.44 as permitted sender) smtp.mailfrom=skhan@linuxfoundation.org; dmarc=pass (policy=none) header.from=linuxfoundation.org X-Rspamd-Server: rspam11 X-Rspamd-Queue-Id: A016814000B X-HE-Tag: 1639157616-517016 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000126, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: ARRAY_SIZE is defined in several selftests. Remove definitions from individual test files and include header file for the define instead. ARRAY_SIZE define is added in a separate patch to prepare for this change. Remove ARRAY_SIZE from vm tests and pickup the one defined in kselftest.h. Signed-off-by: Shuah Khan --- tools/testing/selftests/vm/mremap_test.c | 1 - tools/testing/selftests/vm/pkey-helpers.h | 3 ++- tools/testing/selftests/vm/va_128TBswitch.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/testing/selftests/vm/mremap_test.c b/tools/testing/selftests/vm/mremap_test.c index 0624d1bd71b5..7c0b0617b9f8 100644 --- a/tools/testing/selftests/vm/mremap_test.c +++ b/tools/testing/selftests/vm/mremap_test.c @@ -20,7 +20,6 @@ #define VALIDATION_DEFAULT_THRESHOLD 4 /* 4MB */ #define VALIDATION_NO_THRESHOLD 0 /* Verify the entire region */ -#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) #define MIN(X, Y) ((X) < (Y) ? (X) : (Y)) struct config { diff --git a/tools/testing/selftests/vm/pkey-helpers.h b/tools/testing/selftests/vm/pkey-helpers.h index 622a85848f61..92f3be3dd8e5 100644 --- a/tools/testing/selftests/vm/pkey-helpers.h +++ b/tools/testing/selftests/vm/pkey-helpers.h @@ -13,6 +13,8 @@ #include #include +#include "../kselftest.h" + /* Define some kernel-like types */ #define u8 __u8 #define u16 __u16 @@ -175,7 +177,6 @@ static inline void __pkey_write_allow(int pkey, int do_allow_write) dprintf4("pkey_reg now: %016llx\n", read_pkey_reg()); } -#define ARRAY_SIZE(x) (sizeof(x) / sizeof(*(x))) #define ALIGN_UP(x, align_to) (((x) + ((align_to)-1)) & ~((align_to)-1)) #define ALIGN_DOWN(x, align_to) ((x) & ~((align_to)-1)) #define ALIGN_PTR_UP(p, ptr_align_to) \ diff --git a/tools/testing/selftests/vm/va_128TBswitch.c b/tools/testing/selftests/vm/va_128TBswitch.c index 83acdff26a13..da6ec3b53ea8 100644 --- a/tools/testing/selftests/vm/va_128TBswitch.c +++ b/tools/testing/selftests/vm/va_128TBswitch.c @@ -9,7 +9,7 @@ #include #include -#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0])) +#include "../kselftest.h" #ifdef __powerpc64__ #define PAGE_SIZE (64 << 10)