[PATCH v7 02/17] util/update_headers: Clean up header copying
From: Suzuki K Poulose
Date: Mon Mar 30 2026 - 10:33:13 EST
We copy two kinds of headers. Generic Linux UAPI headers and the ASM UAPI headers
for arch specific targets. Introduce helper functions for each and centralise
the copy process
Signed-off-by: Suzuki K Poulose <suzuki.poulose@xxxxxxx>
---
util/update_headers.sh | 19 +++++++++++--------
1 file changed, 11 insertions(+), 8 deletions(-)
diff --git a/util/update_headers.sh b/util/update_headers.sh
index af75ca36..7902dddb 100755
--- a/util/update_headers.sh
+++ b/util/update_headers.sh
@@ -28,17 +28,19 @@ then
exit 1
fi
-cp -- "$LINUX_ROOT/include/uapi/linux/kvm.h" include/linux
+copy_uapi_linux_header () {
+ cp -- "$LINUX_ROOT/include/uapi/linux/$1" include/linux
+}
-for header in $VIRTIO_LIST
+for header in kvm.h $VIRTIO_LIST
do
- cp -- "$LINUX_ROOT/include/uapi/linux/$header" include/linux
+ copy_uapi_linux_header $header
done
unset KVMTOOL_PATH
-copy_optional_arch () {
- local src="$LINUX_ROOT/arch/$arch/include/uapi/$1"
+copy_uapi_asm_header () {
+ local src="$LINUX_ROOT/arch/$arch/include/uapi/asm/$1"
if [ -r "$src" ]
then
@@ -51,8 +53,9 @@ do
KVMTOOL_PATH=$arch
case $arch in
- arm64) copy_optional_arch asm/sve_context.h ;;
+ arm64)
+ copy_uapi_asm_header sve_context.h
+ ;;
esac
- cp -- "$LINUX_ROOT/arch/$arch/include/uapi/asm/kvm.h" \
- "$KVMTOOL_PATH/include/asm"
+ copy_uapi_asm_header kvm.h
done
--
2.43.0