mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-22 09:11:26 +03:00
virt: hvc_sysfs: Fix build for Linux v6.13
In Linux v6.13, commit 94a20fb9af16 ("sysfs: treewide: constify
attribute callback of bin_attribute::mmap()") changed the type of the
'struct bin_attribute' argument of the bin_attribute:mmap function
pointer to const. Use conftest to detect if this argument is const or
not in the kernel the driver is being compiled against to fix the build.
Bug 4991705
Change-Id: I791d6c9dde50f1444d0339ebd8a18434045f9026
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3261699
Reviewed-by: Manish Bhardwaj <mbhardwaj@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
@@ -6556,6 +6556,27 @@ compile_test() {
|
||||
compile_check_conftest "$CODE" "NV_APERTURE_REMOVE_ALL_CONFLICTING_DEVICES_PRESENT" "" "types"
|
||||
;;
|
||||
|
||||
bin_attribute_struct_mmap_has_const_bin_attribute_arg)
|
||||
#
|
||||
# Determine if the 'bin_attribute' structure 'mmap' function pointer
|
||||
# has const 'struct bin_attribute' argument.
|
||||
#
|
||||
# Commit 94a20fb9af16 ("sysfs: treewide: constify attribute callback
|
||||
# of bin_attribute::mmap()") updated the 'mmap' function pointer to
|
||||
# take a const 'bin_attribute' structure in Linux v6.13.
|
||||
#
|
||||
CODE="
|
||||
#include <linux/sysfs.h>
|
||||
void conftest(struct bin_attribute *attr) {
|
||||
int (*fn)(struct file *, struct kobject *,
|
||||
const struct bin_attribute *,
|
||||
struct vm_area_struct *) = attr->mmap;
|
||||
}"
|
||||
|
||||
compile_check_conftest "$CODE" \
|
||||
"NV_BIN_ATTRIBUTE_STRUCT_MMAP_HAS_CONST_BIN_ATTRIBUTE_ARG" "" "types"
|
||||
;;
|
||||
|
||||
blk_execute_rq_has_no_gendisk_arg)
|
||||
#
|
||||
# Determine if the function blk_execute_rq() has an argument of
|
||||
|
||||
Reference in New Issue
Block a user