tty: wch: Fix build for Linux v6.8

In Linux v6.8, the argument for the struct tty_operations::send_xchar
function was updated from char to u8 and this breaks the build for the
'wch' driver. Add a test to the conftest script to detect the argument
type for this function and use the definition generated to fix the build
for the 'wch' driver.

Bug 4448428

Change-Id: I051861cf76e56cacb4b33053d4e6644265552df7
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3057714
(cherry picked from commit 3f5ba8f70b)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3032444
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
Jon Hunter
2023-12-11 11:58:08 -08:00
committed by mobile promotions
parent 93360eb080
commit 293c8e7b85
3 changed files with 28 additions and 0 deletions

View File

@@ -157,6 +157,7 @@ NV_CONFTEST_FUNCTION_COMPILE_TESTS += spi_get_chipselect
NV_CONFTEST_FUNCTION_COMPILE_TESTS += tc_taprio_qopt_offload_struct_has_cmd
NV_CONFTEST_FUNCTION_COMPILE_TESTS += tegra_dev_iommu_get_stream_id
NV_CONFTEST_FUNCTION_COMPILE_TESTS += tegra_ivc_struct_has_iosys_map
NV_CONFTEST_FUNCTION_COMPILE_TESTS += tty_operations_struct_send_xchar_has_u8_arg
NV_CONFTEST_FUNCTION_COMPILE_TESTS += tty_operations_struct_write_has_u8_ptr_arg
NV_CONFTEST_FUNCTION_COMPILE_TESTS += tty_operations_struct_set_termios_has_const_ktermios_arg
NV_CONFTEST_FUNCTION_COMPILE_TESTS += ufs_hba_variant_ops_suspend_has_status_arg

View File

@@ -7577,6 +7577,25 @@ compile_test() {
compile_check_conftest "$CODE" "NV_TEGRA_DEV_IOMMU_GET_STREAM_ID_PRESENT" "" "functions"
;;
tty_operations_struct_send_xchar_has_u8_arg)
#
# Determine if the struct tty_operations::send_xchar argument is of type u8.
#
# Commit 3a00da027946 ("tty: make tty_operations::send_xchar accept u8 char")
# updated the argument for tty_operations::send_xchar from char to u8 in Linux
# v6.8.
#
CODE="
#include <linux/tty.h>
#include <linux/tty_driver.h>
static inline void conftest_send_xchar(struct tty_struct *ttys, u8 ch) {}
static struct tty_operations tty_ops = {
.send_xchar = conftest_send_xchar,
};"
compile_check_conftest "$CODE" "NV_TTY_OPERATIONS_STRUCT_SEND_XCHAR_HAS_U8_ARG" "" "types"
;;
tty_operations_struct_write_has_u8_ptr_arg)
#
# Determine if the function write() of tty_operations has u8 type pointer argument.