From patchwork Tue Sep 3 15:14:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincenzo Frascino X-Patchwork-Id: 13788875 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 2AF1CCD342A for ; Tue, 3 Sep 2024 15:15:17 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B47728D0195; Tue, 3 Sep 2024 11:15:16 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id AD1008D016E; Tue, 3 Sep 2024 11:15:16 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8D4C08D0195; Tue, 3 Sep 2024 11:15:16 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 6744B8D016E for ; Tue, 3 Sep 2024 11:15:16 -0400 (EDT) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 1AE77A5B38 for ; Tue, 3 Sep 2024 15:15:16 +0000 (UTC) X-FDA: 82523775432.07.0A9C0AF Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf14.hostedemail.com (Postfix) with ESMTP id 50A34100011 for ; Tue, 3 Sep 2024 15:15:14 +0000 (UTC) Authentication-Results: imf14.hostedemail.com; dkim=none; spf=pass (imf14.hostedemail.com: domain of vincenzo.frascino@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=vincenzo.frascino@arm.com; dmarc=pass (policy=none) header.from=arm.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1725376466; a=rsa-sha256; cv=none; b=aRW6JX04OPkrK2TwMDoHQQb2hGDMGMlEozKHJhU5+7e1W+wdOdi8Q3ZmZaaf3nAp4mmaUB CLaWc6IALHX6hXilm6GHsxTqjsxOc0pay/Yik0rVsvlthx71PekNKPforIE+HQf7JNCiki s3ktByEcAa7HjQCz6qt70qoe4CSPLcM= ARC-Authentication-Results: i=1; imf14.hostedemail.com; dkim=none; spf=pass (imf14.hostedemail.com: domain of vincenzo.frascino@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=vincenzo.frascino@arm.com; dmarc=pass (policy=none) header.from=arm.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1725376466; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Yx4X/Nrn3xlPLbwhuHvmtSPmn4DI6UpA1lqALrJpDMg=; b=AwSvAlcTuSjwm5t01vajvO6tcgFQW1+8/j1kUdSinazlzLGh9tglpo+DNHrhqIXmoc7RjF 9Hf9kCWxffx5xy0BE45+aIlyjRo12RMrE3OqWCo3Jw/lZ+wVXC3hI3M3uZxW8vpzbkdkAl EzSfQIgBwVy94yJv3gqxdefD5fZ2uVw= Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 0F1961424; Tue, 3 Sep 2024 08:15:40 -0700 (PDT) Received: from e119884-lin.cambridge.arm.com (e119884-lin.cambridge.arm.com [10.1.196.72]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id AD1443F66E; Tue, 3 Sep 2024 08:15:10 -0700 (PDT) From: Vincenzo Frascino To: linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-mm@kvack.org Cc: Vincenzo Frascino , Andy Lutomirski , Thomas Gleixner , "Jason A . Donenfeld" , Christophe Leroy , Michael Ellerman , Nicholas Piggin , Naveen N Rao , Ingo Molnar , Borislav Petkov , Dave Hansen , "H . Peter Anvin" , Theodore Ts'o , Arnd Bergmann , Andrew Morton , Steven Rostedt , Masami Hiramatsu , Mathieu Desnoyers Subject: [PATCH 6/9] vdso: Split linux/array_size.h Date: Tue, 3 Sep 2024 16:14:34 +0100 Message-Id: <20240903151437.1002990-7-vincenzo.frascino@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240903151437.1002990-1-vincenzo.frascino@arm.com> References: <20240903151437.1002990-1-vincenzo.frascino@arm.com> MIME-Version: 1.0 X-Stat-Signature: kya4rq7p4ecs6w9dksszr97315ha8gq5 X-Rspamd-Queue-Id: 50A34100011 X-Rspam-User: X-Rspamd-Server: rspam10 X-HE-Tag: 1725376514-865224 X-HE-Meta: U2FsdGVkX19GuucTmtLiCRhoZxMplXZHeK/KugyyUDJAT63niSAXRPHd5FavrJAXWqoMi6sejRr7CVyCn0v3FqpN6Lln4oc4EzgAzuWiqdjDITVhFOYX9iAHjXcrrMCFTSxSN5FtBeiHgIIzxiCeVZ29jv++mScmQ1rHncHsplOrN5rbJ5FSv2kjYVsi2RlSs+iofJ4vj7z0yCceylUfv4RK5vNV1/W7QwAgYDC5JTK9cQxPzteIJr3znhYf/VpjvQtrBavp8MIvSUa7VQTV2vqoq2tUezdFf3Wbn5FQsIo+uqrCCOqHJJMFmSHaIehC5eWxeL4R99MUjw4UTCAeTg9Do+GHMQ7zh4UgOp33vvTdUcmXQ1jmVKfvF2hKcKqEEgcfEDPyN1QsV9E8Anl4jOii7vfoigsj4It5tlJrg2c50wLNiGJtARMkS6vx9fg6PdBv+Fv/tR6jcWbg5Pin6o0zTjZKLQ5v3TZ2R2np+oKrZnym2FwCX+xBGU+0xd6fUVzyKYDUUzG+U1N4Q16kpeNytW8k+paQCiCxTSBCb8FlhIdDbAeox5AWfu0k8o4dJfKtCXWIlTcivTHYvhlxxWuNfgfFbypYveWMpNXj2fXf5qlWEk4gOmNctILasvFIvIMoaLE+RC4QCEDv7zxIAZKlCFsFOLOKFPpBM8HOawisQJHo1B5SKlcoH7Xl1sdCdS/xGbFM6P2g+ZUaiX7JvqoWRw0DayEH/pLaa1ELDWnYgfdQSsX6z7psaUToRdhnmLKLLZ5xi98VZCgvAp/eQVhP1ZPTkhZfi1RNkoZj8T0oCHN7evloVY+s6JQG+KH3EaiEZ3FLC0AKF1cWEj3JuUzRC/Rt+05+eOZGBOqgbQhtGUa5qUl6dwCa9coJ6qlqOUbtQ4rYSb5tvaV6vsdecghetZ8iYxgw7TAQxQnReVxVReR9SGkVUxRpj1vWspJt/Jzjlo8C4f71sT0KvbD u1+9MjQr q0zad/0KDq0YSTbKIeTED5m3Z0es/XUESwH6vHMtl1F83IhwzTOu1pMR7dOK0o+6mB25cBZd2trvEQbkaVlIBsDqEHFH3wGUdLoswl1uSs8mRe9QeZAvkEYB86jL0qAhDw398B7ju3B50EvvSYk4FCG5b8z80p6UV3HyJyp8VPn0rIRe3CDNG3gaZknXrwpjdYpHRYqBkjHUoDGHgQoVRB21A306Xve9NC28Mq1R16Q/mcQtzxG0hhDFn5xKebqRmhALcbjRLZE80v//3gTY9keyV6KKMMLUvkMS1 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: The VDSO implementation includes headers from outside of the vdso/ namespace. Split linux/array_size.h to make sure that the generic library uses only the allowed namespace. Cc: Andy Lutomirski Cc: Thomas Gleixner Cc: Jason A. Donenfeld Signed-off-by: Vincenzo Frascino --- include/linux/array_size.h | 8 +------- include/vdso/array_size.h | 13 +++++++++++++ 2 files changed, 14 insertions(+), 7 deletions(-) create mode 100644 include/vdso/array_size.h diff --git a/include/linux/array_size.h b/include/linux/array_size.h index 06d7d83196ca..ca9e63b419c4 100644 --- a/include/linux/array_size.h +++ b/include/linux/array_size.h @@ -2,12 +2,6 @@ #ifndef _LINUX_ARRAY_SIZE_H #define _LINUX_ARRAY_SIZE_H -#include - -/** - * ARRAY_SIZE - get the number of elements in array @arr - * @arr: array to be sized - */ -#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr)) +#include #endif /* _LINUX_ARRAY_SIZE_H */ diff --git a/include/vdso/array_size.h b/include/vdso/array_size.h new file mode 100644 index 000000000000..4079f7a5f86e --- /dev/null +++ b/include/vdso/array_size.h @@ -0,0 +1,13 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef _VDSO_ARRAY_SIZE_H +#define _VDSO_ARRAY_SIZE_H + +#include + +/** + * ARRAY_SIZE - get the number of elements in array @arr + * @arr: array to be sized + */ +#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr)) + +#endif /* _VDSO_ARRAY_SIZE_H */