From 0a8cf5a885bd7d7db0581476f298459228eddf0b Mon Sep 17 00:00:00 2001 From: Shen Jiamin Date: Sat, 30 May 2026 20:09:13 +0800 Subject: [PATCH 1/2] driver: Fix Kbuild compiler flags assignment in Makefile Clean up the assignment spacing and appending operators for `ccflags-y` to conform to standard Makefile style guidelines. Signed-off-by: Shen Jiamin --- sw/AMI/driver/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sw/AMI/driver/Makefile b/sw/AMI/driver/Makefile index c429fcf..85a7f61 100755 --- a/sw/AMI/driver/Makefile +++ b/sw/AMI/driver/Makefile @@ -25,7 +25,7 @@ $(TARGET_MODULE)-objs += gcq-driver/src/gcq_driver.o $(TARGET_MODULE)-objs += gcq-driver/src/gcq_hw.o $(TARGET_MODULE)-objs += gcq-driver/src/gcq_features.o -EXTRA_CFLAGS:=-I$(PWD) -I$(PWD)/fal -I$(PWD)/fal/gcq -I$(PWD)/gcq-driver/src +ccflags-y := -I$(PWD) -I$(PWD)/fal -I$(PWD)/fal/gcq -I$(PWD)/gcq-driver/src KERNEL_DIR = /lib/modules/`uname -r`/build @@ -33,8 +33,8 @@ KERNEL_DIR = /lib/modules/`uname -r`/build # CFLAGS_versal_vmc.o:=-DDEBUG #To apply the macro to all the source files compiled with this makefile -# ccflags-y:=-DDEBUG -ccflags-y:=-DDEBUG -DVERBOSE_DEBUG -DGCQ_MAX_INSTANCES=16 +ccflags-y += -DDEBUG +ccflags-y += -DVERBOSE_DEBUG -DGCQ_MAX_INSTANCES=16 all: clean @test -f ../scripts/getVersion.sh && ../scripts/getVersion.sh driver $(realpath .) || echo "" From 6a94d4eaa1a6139687926f2b671c1ddc83e23aa5 Mon Sep 17 00:00:00 2001 From: Shen Jiamin Date: Sat, 30 May 2026 20:18:02 +0800 Subject: [PATCH 2/2] driver: Include linux/vmalloc.h explicitly to fix implicit declaration errors The driver uses functions like vzalloc() and vfree() across multiple files but relies on implicit header inclusion. Fix the compilation errors by explicitly including in ami_amc_control.c, ami_cdev.c, ami_sensor.c, and ami_sysfs.c. Signed-off-by: Shen Jiamin --- sw/AMI/driver/ami_amc_control.c | 1 + sw/AMI/driver/ami_cdev.c | 1 + sw/AMI/driver/ami_sensor.c | 1 + sw/AMI/driver/ami_sysfs.c | 1 + 4 files changed, 4 insertions(+) diff --git a/sw/AMI/driver/ami_amc_control.c b/sw/AMI/driver/ami_amc_control.c index 146b3d5..583b1d6 100755 --- a/sw/AMI/driver/ami_amc_control.c +++ b/sw/AMI/driver/ami_amc_control.c @@ -9,6 +9,7 @@ #include #include #include +#include #include "gcq.h" #include "ami_top.h" diff --git a/sw/AMI/driver/ami_cdev.c b/sw/AMI/driver/ami_cdev.c index 834e5d3..b727dc4 100755 --- a/sw/AMI/driver/ami_cdev.c +++ b/sw/AMI/driver/ami_cdev.c @@ -15,6 +15,7 @@ #include #include #include +#include #include "ami.h" #include "ami_hwmon.h" diff --git a/sw/AMI/driver/ami_sensor.c b/sw/AMI/driver/ami_sensor.c index 9350f21..4203499 100755 --- a/sw/AMI/driver/ami_sensor.c +++ b/sw/AMI/driver/ami_sensor.c @@ -8,6 +8,7 @@ #include #include #include +#include #include "ami_top.h" #include "ami_sensor.h" diff --git a/sw/AMI/driver/ami_sysfs.c b/sw/AMI/driver/ami_sysfs.c index f2f3122..e63e3a4 100644 --- a/sw/AMI/driver/ami_sysfs.c +++ b/sw/AMI/driver/ami_sysfs.c @@ -7,6 +7,7 @@ #include #include +#include #include "ami.h" #include "ami_top.h"