mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Fang Xieyan <fangxy@xiaopeng.com>
To: Andy Lutomirski <luto@kernel.org>,
	Thomas Gleixner <tglx@kernel.org>,
	Vincenzo Frascino <vincenzo.frascino@arm.com>,
	x86@kernel.org
Cc: "Ingo Molnar" <mingo@redhat.com>,
	"Borislav Petkov" <bp@alien8.de>,
	"Dave Hansen" <dave.hansen@linux.intel.com>,
	"Arnd Bergmann" <arnd@arndb.de>,
	"Thomas Weißschuh" <linux@weissschuh.net>,
	"Huacai Chen" <chenhuacai@kernel.org>,
	"WANG Xuerui" <kernel@xen0n.name>,
	"Paul Walmsley" <pjw@kernel.org>,
	"Palmer Dabbelt" <palmer@dabbelt.com>,
	"Albert Ou" <aou@eecs.berkeley.edu>,
	"Alexandre Ghiti" <alex@ghiti.fr>,
	linux-arch@vger.kernel.org, linux-riscv@lists.infradead.org,
	loongarch@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: [RFC PATCH 4/5] riscv: Drop redundant internal header includes from the vDSO sources
Date: Tue,  1 Dec 2026 19:55:22 +0800	[thread overview]
Message-ID: <20261201115523.75606-5-fangxy@xiaopeng.com> (raw)
In-Reply-To: <20261201115523.75606-1-fangxy@xiaopeng.com>

With the sanctioned headers providing all types through <vdso/types.h>,
the direct includes of internal headers in the riscv vDSO sources are
dead weight: they are the only thing keeping the <linux/types.h> ->
<asm/...> -> bitsperlong chain alive inside these vDSO translation
units.

The vDSO Makefile already force-includes the sanctioned headers
(c-gettimeofday-y / c-getrandom-y), so the same code shape as the
include-free arm64 vDSO sources can be used here.  <linux/time.h> in
vgettimeofday.c is redundant for the same reason: struct
__kernel_timespec and friends reach the file through the same chain.

hwprobe.c is left untouched: it still needs <linux/string.h> from the
internal chain, a separate cleanup.

Signed-off-by: Fang Xieyan <fangxy@xiaopeng.com>
---
Build-tested at the series tip (this patch and patch 5 both applied):
riscv64 defconfig cross-build (clang --target=riscv64-linux-gnu)
completes with 0 errors and still produces
arch/riscv/kernel/vdso/vdso.so(.dbg); the riscv sources are identical
between this commit and the tested tip.

 arch/riscv/kernel/vdso/getrandom.c     | 1 -
 arch/riscv/kernel/vdso/vgettimeofday.c | 2 --
 2 files changed, 3 deletions(-)

diff --git a/arch/riscv/kernel/vdso/getrandom.c b/arch/riscv/kernel/vdso/getrandom.c
index f21922e8cebd..6524e918c494 100644
--- a/arch/riscv/kernel/vdso/getrandom.c
+++ b/arch/riscv/kernel/vdso/getrandom.c
@@ -2,7 +2,6 @@
 /*
  * Copyright (C) 2025 Xi Ruoyao <xry111@xry111.site>. All Rights Reserved.
  */
-#include <linux/types.h>
 
 ssize_t __vdso_getrandom(void *buffer, size_t len, unsigned int flags, void *opaque_state, size_t opaque_len)
 {
diff --git a/arch/riscv/kernel/vdso/vgettimeofday.c b/arch/riscv/kernel/vdso/vgettimeofday.c
index b35057802584..57bd32c5bf2b 100644
--- a/arch/riscv/kernel/vdso/vgettimeofday.c
+++ b/arch/riscv/kernel/vdso/vgettimeofday.c
@@ -6,8 +6,6 @@
  * Copyright (C) 2020 SiFive
  */
 
-#include <linux/time.h>
-#include <linux/types.h>
 #include <vdso/gettime.h>
 
 int __vdso_clock_gettime(clockid_t clock, struct __kernel_timespec *ts)
-- 
2.50.1


  parent reply	other threads:[~2026-12-01 11:55 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-01 11:55 [RFC PATCH 0/5] vdso: Provide a sanitized subset of UAPI types for vDSO code Fang Xieyan
2026-12-01 11:55 ` [RFC PATCH 1/5] vdso: Provide a sanitized subset of UAPI types Fang Xieyan
2026-12-01 11:55 ` [RFC PATCH 2/5] x86/vdso: Drop redundant kernel header includes Fang Xieyan
2026-12-01 11:55 ` [RFC PATCH 3/5] vdso: Switch the sanctioned headers to vdso/types.h Fang Xieyan
2026-12-01 11:55 ` Fang Xieyan [this message]
2026-12-01 11:55 ` [RFC PATCH 5/5] loongarch: Drop redundant internal header includes from the vDSO sources Fang Xieyan
  -- strict thread matches above, loose matches on Subject: below --
2026-12-01 10:24 [RFC PATCH 0/5] vdso: Provide a sanitized subset of UAPI types for vDSO code Fang Xieyan
2026-12-01 10:24 ` [RFC PATCH 4/5] riscv: Drop redundant internal header includes from the vDSO sources Fang Xieyan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261201115523.75606-5-fangxy@xiaopeng.com \
    --to=fangxy@xiaopeng.com \
    --cc=alex@ghiti.fr \
    --cc=aou@eecs.berkeley.edu \
    --cc=arnd@arndb.de \
    --cc=bp@alien8.de \
    --cc=chenhuacai@kernel.org \
    --cc=dave.hansen@linux.intel.com \
    --cc=kernel@xen0n.name \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=linux@weissschuh.net \
    --cc=loongarch@lists.linux.dev \
    --cc=luto@kernel.org \
    --cc=mingo@redhat.com \
    --cc=palmer@dabbelt.com \
    --cc=pjw@kernel.org \
    --cc=tglx@kernel.org \
    --cc=vincenzo.frascino@arm.com \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®