Fix driver build failures by correcting Kbuild flags and missing vmalloc header#36
Open
taraxacum45e9a wants to merge 2 commits into
Open
Fix driver build failures by correcting Kbuild flags and missing vmalloc header#36taraxacum45e9a wants to merge 2 commits into
taraxacum45e9a wants to merge 2 commits into
Conversation
Clean up the assignment spacing and appending operators for `ccflags-y` to conform to standard Makefile style guidelines. Signed-off-by: Shen Jiamin <shen_jiamin@comp.nus.edu.sg>
…n 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 <linux/vmalloc.h> in ami_amc_control.c, ami_cdev.c, ami_sensor.c, and ami_sysfs.c. Signed-off-by: Shen Jiamin <shen_jiamin@comp.nus.edu.sg>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR addresses two critical compilation issues that were preventing the AMI driver from building successfully on newer kernel versions:
EXTRA_CFLAGS):Modern Kbuild environments deprecate or ignore local
EXTRA_CFLAGSvariable assignments when executing sub-makes, causing the-Iinclude paths for local dependencies to be lost. This has been fixed by properly appending the include paths toccflags-y.vzalloc/vfree):The driver utilizes memory allocation functions like
vzalloc()andvfree()across multiple files without explicitly importing their definitions. This caused build failures on newer, stricter kernel headers. Explicit#include <linux/vmalloc.h>directives have been added to the affected source files.Changes
Makefile: Appended header include paths directly toccflags-yinstead of the defunctEXTRA_CFLAGS.sw/AMI/driver/ami_amc_control.c: Added<linux/vmalloc.h>inclusion.sw/AMI/driver/ami_cdev.c: Added<linux/vmalloc.h>inclusion.sw/AMI/driver/ami_sensor.c: Added<linux/vmalloc.h>inclusion.sw/AMI/driver/ami_sysfs.c: Added<linux/vmalloc.h>inclusion.Fix: #35