error: initialization of ‘void (*)(struct uart_port *, struct ktermios *, const struct ktermios *)’ from incompatible pointer type ‘void (*)(struct uart_port *, struct ktermios *, struct ktermios *)
Driver is not compiling in mdis-setup2 Red Hat Enterprise Linux release 9.2 (Plow)
under the following kernel Linux localhost.localdomain 5.14.0-284.30.1.el9_2.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Aug 25 09:13:12 EDT 2023 x86_64 x86_64 x86_64 GNU/Linux
Steps to reproduce:
sudo ./INSTALL.sh
and say y in all questions. Result:
### Compiling kernel modules ###
CC [M] /home/dua/felipe/13MD05-90/OBJ/nodbg/men_lx_z135/men_mdis_z135.o
In file included from /home/dua/felipe/13MD05-90/OBJ/nodbg/men_lx_z135/men_mdis_z135.c:28:
/opt/menlinux/DRIVERS/13Z135/men_16z135.c:819:24: error: initialization of ‘void (*)(struct uart_port *, struct ktermios *, const struct ktermios *)’ from incompatible pointer type ‘void (*)(struct uart_port *, struct ktermios *, struct ktermios *)’ [-Werror=incompatible-pointer-types]
819 | .set_termios = men_z135_set_termios,
| ^~~~~~~~~~~~~~~~~~~~
/opt/menlinux/DRIVERS/13Z135/men_16z135.c:819:24: note: (near initialization for ‘men_z135_ops.set_termios’)
cc1: some warnings being treated as errors
make[4]: *** [scripts/Makefile.build:321: /home/dua/felipe/13MD05-90/OBJ/nodbg/men_lx_z135/men_mdis_z135.o] Error 1
make[3]: *** [scripts/Makefile.build:607: /home/dua/felipe/13MD05-90/OBJ/nodbg/men_lx_z135] Error 2
make[2]: *** [Makefile:1923: /home/dua/felipe/13MD05-90/OBJ] Error 2
make[1]: *** [/opt/menlinux/BUILD/MDIS/TPL/rules.mak:532: callkernelbuild] Error 2
make: *** [/opt/menlinux/BUILD/MDIS/TPL/rules.mak:430: nodbg] Error 2
In the mentioned line 819, it is referenced the function men_z135_set_termios
, that in line 685 would expect a const as argument with an #ifdef
starting in kernel version 6.1. It seems that this change to the version 6.1 was patched and backported to 5.14. It must be investigated wether this is a general kernel 5.14 backport or only in this red hat release was backported. And then fix the problem in all supported kernels and releases.
This problem did not happen in the release 2 weeks ago, but is happpening after the pxe update in mdis2-setup:
172.26.4.9:/var/local/pxeboot/images/rootfs/rhel-9.2-rootfs on / type nfs4 (rw,relatime,vers=4.2,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,clientaddr=172.26.4.102,local_lock=none,addr=172.26.4.9)