Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated needed for Linux 6.8: Build of module fails with error: passing argument 1 of ‘class_create’ from incompatible pointer type [-Werror=incompatible-pointer-types] #10

Open
dreirund opened this issue Mar 24, 2024 · 1 comment

Comments

@dreirund
Copy link

It seems it needs update for at least Linux 6.8:

DKMS make.log for dev_one-r15.20230110.0171589 for kernel 6.8.0-pf2 (x86_64)
Sun Mar 24 07:31:39 PM CET 2024
# Run kernel build system to make module
Compiling
make -C /lib/modules/6.8.0-pf2/build M=/var/lib/dkms/dev_one/r15.20230110.0171589/build modules
make[1]: Entering directory '/usr/lib/modules/6.8.0-pf2/build'
  CC [M]  /var/lib/dkms/dev_one/r15.20230110.0171589/build/one.o
/var/lib/dkms/dev_one/r15.20230110.0171589/build/one.c:51:5: warning: no previous prototype for ‘register_device’ [-Wmissing-prototypes]
   51 | int register_device(void) {
      |     ^~~~~~~~~~~~~~~
In file included from /var/lib/dkms/dev_one/r15.20230110.0171589/build/one.c:6:
/var/lib/dkms/dev_one/r15.20230110.0171589/build/one.c: In function ‘register_device’:
./include/linux/init.h:184:22: error: passing argument 1 of ‘class_create’ from incompatible pointer type [-Werror=incompatible-pointer-types]
  184 | #define THIS_MODULE (&__this_module)
      |                     ~^~~~~~~~~~~~~~~
      |                      |
      |                      struct module *
/var/lib/dkms/dev_one/r15.20230110.0171589/build/one.c:69:28: note: in expansion of macro ‘THIS_MODULE’
   69 |     if ((cl = class_create(THIS_MODULE, "chardrv")) == NULL) {
      |                            ^~~~~~~~~~~
In file included from ./include/linux/device.h:31,
                 from /var/lib/dkms/dev_one/r15.20230110.0171589/build/one.c:11:
./include/linux/device/class.h:228:54: note: expected ‘const char *’ but argument is of type ‘struct module *’
  228 | struct class * __must_check class_create(const char *name);
      |                                          ~~~~~~~~~~~~^~~~
/var/lib/dkms/dev_one/r15.20230110.0171589/build/one.c:69:15: error: too many arguments to function ‘class_create’
   69 |     if ((cl = class_create(THIS_MODULE, "chardrv")) == NULL) {
      |               ^~~~~~~~~~~~
./include/linux/device/class.h:228:29: note: declared here
  228 | struct class * __must_check class_create(const char *name);
      |                             ^~~~~~~~~~~~
/var/lib/dkms/dev_one/r15.20230110.0171589/build/one.c: At top level:
/var/lib/dkms/dev_one/r15.20230110.0171589/build/one.c:103:6: warning: no previous prototype for ‘unregister_device’ [-Wmissing-prototypes]
  103 | void unregister_device(void) {
      |      ^~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
make[3]: *** [scripts/Makefile.build:243: /var/lib/dkms/dev_one/r15.20230110.0171589/build/one.o] Error 1
make[2]: *** [/usr/lib/modules/6.8.0-pf2/build/Makefile:1921: /var/lib/dkms/dev_one/r15.20230110.0171589/build] Error 2
make[1]: *** [Makefile:240: __sub-make] Error 2
make[1]: Leaving directory '/usr/lib/modules/6.8.0-pf2/build'
make: *** [Makefile:69: build] Error 2

Regards!

@dreirund dreirund changed the title Build of module fails with error: passing argument 1 of ‘class_create’ from incompatible pointer type [-Werror=incompatible-pointer-types] **Needs to be updated for Linux 6.8**: Build of module fails with error: passing argument 1 of ‘class_create’ from incompatible pointer type [-Werror=incompatible-pointer-types] Apr 22, 2024
@dreirund dreirund changed the title **Needs to be updated for Linux 6.8**: Build of module fails with error: passing argument 1 of ‘class_create’ from incompatible pointer type [-Werror=incompatible-pointer-types] Updated needed for Linux 6.8: Build of module fails with error: passing argument 1 of ‘class_create’ from incompatible pointer type [-Werror=incompatible-pointer-types] Apr 22, 2024
@dreirund
Copy link
Author

dreirund commented Aug 21, 2024

@tinmarino, what is the state of dealing with this issue?

Regards and thanks for this module!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant