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

Fix module building failed after Linux 6.4 #13

Merged
merged 2 commits into from
Sep 26, 2023
Merged

Conversation

25077667
Copy link
Contributor

There is the output from Linux 6.5.4 without this patch:

➜ fibdrv git:(master) make

Git hooks are installed successfully.

cc -o client client.c
make -C /lib/modules/6.5.4-arch2-1/build M=/home/scc/git/fibdrv modules
make[1]: Entering directory '/usr/lib/modules/6.5.4-arch2-1/build'
CC [M] /home/scc/git/fibdrv/fibdrv.o
/home/scc/git/fibdrv/fibdrv.c: In function ‘fib_sequence’:
/home/scc/git/fibdrv/fibdrv.c:30:5: warning: ISO C90 forbids variable length array ‘f’ [-Wvla]
30 | long long f[k + 2];
| ^~~~
In file included from ./include/linux/linkage.h:7,
from ./arch/x86/include/asm/cache.h:5,
from ./include/linux/cache.h:6,
from ./arch/x86/include/asm/current.h:9,
from ./include/linux/mutex.h:14,
from ./include/linux/kernfs.h:11,
from ./include/linux/sysfs.h:16,
from ./include/linux/kobject.h:20,
from ./include/linux/cdev.h:5,
from /home/scc/git/fibdrv/fibdrv.c:1:
/home/scc/git/fibdrv/fibdrv.c: In function ‘init_fib_dev’:
./include/linux/export.h:29:22: error: passing argument 1 of ‘class_create’ from incompatible pointer type [-Werror=incompatible-pointer-types]
29 | #define THIS_MODULE (&__this_module)
| ~^~~~~~~~~~~~~~~
| |
| struct module *
/home/scc/git/fibdrv/fibdrv.c:122:30: note: in expansion of macro ‘THIS_MODULE’
122 | fib_class = class_create(THIS_MODULE, DEV_FIBONACCI_NAME);
| ^~~~~~~~~~~
In file included from ./include/linux/device.h:31,
from ./include/linux/cdev.h:8:
./include/linux/device/class.h:230:54: note: expected ‘const char *’ but argument is of type ‘struct module *’
230 | struct class * __must_check class_create(const char *name);
| ~~~~~~~~~~~~^~~~
/home/scc/git/fibdrv/fibdrv.c:122:17: error: too many arguments to function ‘class_create’
122 | fib_class = class_create(THIS_MODULE, DEV_FIBONACCI_NAME);
| ^~~~~~~~~~~~
./include/linux/device/class.h:230:29: note: declared here
230 | struct class * __must_check class_create(const char *name);
| ^~~~~~~~~~~~
cc1: some warnings being treated as errors
make[3]: *** [scripts/Makefile.build:243: /home/scc/git/fibdrv/fibdrv.o] Error 1
make[2]: *** [/usr/lib/modules/6.5.4-arch2-1/build/Makefile:2034: /home/scc/git/fibdrv] Error 2
make[1]: *** [Makefile:234: __sub-make] Error 2
make[1]: Leaving directory '/usr/lib/modules/6.5.4-arch2-1/build'
make: *** [Makefile:13: all] Error 2

@25077667
Copy link
Contributor Author

25077667 commented Sep 26, 2023

I found this issue had been nounce at Bug#1039572: sl-modem-dkms: module fails to build for Linux 6.4

fibdrv.c Outdated Show resolved Hide resolved
@jserv jserv merged commit 5ce76d4 into sysprog21:master Sep 26, 2023
2 checks passed
@jserv
Copy link
Contributor

jserv commented Sep 26, 2023

Thank @25077667 for contributing!

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

Successfully merging this pull request may close these issues.

2 participants