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, };