diff --git a/Makefile b/Makefile index 996053b1..10b45eac 100644 --- a/Makefile +++ b/Makefile @@ -9,7 +9,6 @@ subdir-ccflags-y += -Werror LINUX_VERSION := $(shell expr $(VERSION) \* 256 + $(PATCHLEVEL)) LINUX_VERSION_6_2 := $(shell expr 6 \* 256 + 2) LINUX_VERSION_6_3 := $(shell expr 6 \* 256 + 3) -LINUX_VERSION_6_4 := $(shell expr 6 \* 256 + 4) LINUX_VERSION_6_6 := $(shell expr 6 \* 256 + 6) LINUX_VERSION_6_7 := $(shell expr 6 \* 256 + 7) @@ -28,12 +27,6 @@ ifeq ($(shell test $(LINUX_VERSION) -ge $(LINUX_VERSION_6_3); echo $$?),0) export CONFIG_TEGRA_GPIO_LEGACY_DISABLE=y endif -# Changes done in Linux 6.4 onwards -ifeq ($(shell test $(LINUX_VERSION) -ge $(LINUX_VERSION_6_4); echo $$?),0) -# Argument on class attribute callback changed to constant type -subdir-ccflags-y += -DNV_CLASS_ATTRIBUTE_STRUCT_HAS_CONST_STRUCT_CLASS_ARG -endif - # Changes done in Linux 6.6 onwards ifeq ($(shell test $(LINUX_VERSION) -ge $(LINUX_VERSION_6_6); echo $$?),0) # Crypto driver has major change in it ops, skip it diff --git a/drivers/virt/tegra/tegra_hv.c b/drivers/virt/tegra/tegra_hv.c index 5bf249fa..cb1d313a 100644 --- a/drivers/virt/tegra/tegra_hv.c +++ b/drivers/virt/tegra/tegra_hv.c @@ -416,7 +416,7 @@ static void tegra_hv_cleanup(struct tegra_hv_data *hvd) } } -#if defined(NV_CLASS_ATTRIBUTE_STRUCT_HAS_CONST_STRUCT_CLASS_ARG) +#if defined(NV_CLASS_ATTRIBUTE_STRUCT_HAS_CONST_STRUCT_CLASS_ATTRIBUTE_ARG) static ssize_t vmid_show(const struct class *class, const struct class_attribute *attr, char *buf) #else diff --git a/scripts/conftest/Makefile b/scripts/conftest/Makefile index d9e56ffa..5313da61 100644 --- a/scripts/conftest/Makefile +++ b/scripts/conftest/Makefile @@ -96,6 +96,7 @@ NV_CONFTEST_FUNCTION_COMPILE_TESTS += block_device_operations_open_has_gendisk_a NV_CONFTEST_FUNCTION_COMPILE_TESTS += block_device_operations_release_has_no_mode_arg NV_CONFTEST_FUNCTION_COMPILE_TESTS += bus_type_struct_remove_has_int_return_type NV_CONFTEST_FUNCTION_COMPILE_TESTS += bus_type_struct_uevent_has_const_dev_arg +NV_CONFTEST_FUNCTION_COMPILE_TESTS += class_attribute_struct_has_const_struct_class_attribute NV_CONFTEST_FUNCTION_COMPILE_TESTS += class_create_has_no_owner_arg NV_CONFTEST_FUNCTION_COMPILE_TESTS += class_struct_devnode_has_const_dev_arg NV_CONFTEST_FUNCTION_COMPILE_TESTS += define_semaphore_has_number_arg diff --git a/scripts/conftest/conftest.sh b/scripts/conftest/conftest.sh index 1ce2c9fe..a1d6dd7a 100755 --- a/scripts/conftest/conftest.sh +++ b/scripts/conftest/conftest.sh @@ -6514,6 +6514,26 @@ compile_test() { compile_check_conftest "$CODE" "NV_BUS_TYPE_STRUCT_UEVENT_HAS_CONST_DEV_ARG" "" "types" ;; + class_attribute_struct_has_const_struct_class_attribute) + # + # Determine if struct class_attribute function has const type "struct class_attribute" + # argument or not. + # + # Modified the argument by change commit 75a2d4226b5371 ("driver core: class: mark + # the struct class for sysfs callbacks as constant") for Linux 6.3 + # + CODE=" + #include + static ssize_t show_cb(struct class *class, struct class_attribute *attr, char *buf) { + return 0; + } + static struct class_attribute ca = { + .show = show_cb, + };" + + compile_check_conftest "$CODE" "NV_CLASS_ATTRIBUTE_STRUCT_HAS_CONST_STRUCT_CLASS_ATTRIBUTE_ARG" "" "functions" + ;; + class_create_has_no_owner_arg) # # Determine if the class_create() function has the 'owner' argument.