forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 16
Open
Labels
-Wincompatible-function-pointer-types-strict[BUG] linuxA bug that should be fixed in the mainline kernel.A bug that should be fixed in the mainline kernel.[PATCH] RejectedThe submitted patch was rejectedThe submitted patch was rejected
Description
$ make -skj"$(nproc)" ARCH=arm64 LLVM=1 clean allmodconfig drivers/counter/
drivers/counter/counter-chrdev.c:323:34: error: incompatible function pointer types assigning to 'int (*)(struct counter_device *, struct counter_signal *, u32 *)' (aka 'int (*)(struct counter_device *, struct counter_signal *, unsigned int *)') from 'int (*const)(struct counter_device *, struct counter_signal *, enum counter_signal_level *)' [-Werror,-Wincompatible-function-pointer-types-strict]
323 | comp_node.comp.signal_u32_read = counter->ops->signal_read;
| ^ ~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/counter/counter-chrdev.c:337:33: error: incompatible function pointer types assigning to 'int (*)(struct counter_device *, struct counter_count *, u32 *)' (aka 'int (*)(struct counter_device *, struct counter_count *, unsigned int *)') from 'int (*const)(struct counter_device *, struct counter_count *, enum counter_function *)' [-Werror,-Wincompatible-function-pointer-types-strict]
337 | comp_node.comp.count_u32_read = counter->ops->function_read;
| ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 errors generated.
make[6]: *** [scripts/Makefile.build:287: drivers/counter/counter-chrdev.o] Error 1
drivers/counter/rz-mtu3-cnt.c:612:2: error: incompatible function pointer types initializing 'int (*)(struct counter_device *, struct counter_count *, u32 *)' (aka 'int (*)(struct counter_device *, struct counter_count *, unsigned int *)') with an expression of type 'int (struct counter_device *, struct counter_count *, enum counter_count_direction *)' [-Werror,-Wincompatible-function-pointer-types-strict]
612 | COUNTER_COMP_DIRECTION(rz_mtu3_count_direction_read),
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/counter.h:599:20: note: expanded from macro 'COUNTER_COMP_DIRECTION'
599 | .count_u32_read = (_read), \
| ^~~~~~~
1 error generated.
make[6]: *** [scripts/Makefile.build:287: drivers/counter/rz-mtu3-cnt.o] Error 1
drivers/counter/counter-sysfs.c:851:23: error: incompatible function pointer types assigning to 'int (*)(struct counter_device *, struct counter_signal *, u32 *)' (aka 'int (*)(struct counter_device *, struct counter_signal *, unsigned int *)') from 'int (*const)(struct counter_device *, struct counter_signal *, enum counter_signal_level *)' [-Werror,-Wincompatible-function-pointer-types-strict]
851 | comp.signal_u32_read = counter->ops->signal_read;
| ^ ~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/counter/counter-sysfs.c:964:22: error: incompatible function pointer types assigning to 'int (*)(struct counter_device *, struct counter_count *, u32 *)' (aka 'int (*)(struct counter_device *, struct counter_count *, unsigned int *)') from 'int (*const)(struct counter_device *, struct counter_count *, enum counter_function *)' [-Werror,-Wincompatible-function-pointer-types-strict]
964 | comp.count_u32_read = counter->ops->function_read;
| ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/counter/counter-sysfs.c:965:23: error: incompatible function pointer types assigning to 'int (*)(struct counter_device *, struct counter_count *, u32)' (aka 'int (*)(struct counter_device *, struct counter_count *, unsigned int)') from 'int (*const)(struct counter_device *, struct counter_count *, enum counter_function)' [-Werror,-Wincompatible-function-pointer-types-strict]
965 | comp.count_u32_write = counter->ops->function_write;
| ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3 errors generated.
make[6]: *** [scripts/Makefile.build:287: drivers/counter/counter-sysfs.o] Error 1
drivers/counter/ti-eqep.c:404:2: error: incompatible function pointer types initializing 'int (*)(struct counter_device *, struct counter_count *, u32 *)' (aka 'int (*)(struct counter_device *, struct counter_count *, unsigned int *)') with an expression of type 'int (struct counter_device *, struct counter_count *, enum counter_count_direction *)' [-Werror,-Wincompatible-function-pointer-types-strict]
404 | COUNTER_COMP_DIRECTION(ti_eqep_direction_read),
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/counter.h:599:20: note: expanded from macro 'COUNTER_COMP_DIRECTION'
599 | .count_u32_read = (_read), \
| ^~~~~~~
1 error generated.
make[6]: *** [scripts/Makefile.build:287: drivers/counter/ti-eqep.o] Error 1
drivers/counter/stm32-timer-cnt.c:334:2: error: incompatible function pointer types initializing 'int (*)(struct counter_device *, struct counter_count *, u32 *)' (aka 'int (*)(struct counter_device *, struct counter_count *, unsigned int *)') with an expression of type 'int (struct counter_device *, struct counter_count *, enum counter_count_direction *)' [-Werror,-Wincompatible-function-pointer-types-strict]
334 | COUNTER_COMP_DIRECTION(stm32_count_direction_read),
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/counter.h:599:20: note: expanded from macro 'COUNTER_COMP_DIRECTION'
599 | .count_u32_read = (_read), \
| ^~~~~~~
1 error generated.
make[6]: *** [scripts/Makefile.build:287: drivers/counter/stm32-timer-cnt.o] Error 1
drivers/counter/104-quad-8.c:1070:2: error: incompatible function pointer types initializing 'int (*)(struct counter_device *, struct counter_signal *, u32 *)' (aka 'int (*)(struct counter_device *, struct counter_signal *, unsigned int *)') with an expression of type 'int (struct counter_device *, struct counter_signal *, enum counter_signal_polarity *)' [-Werror,-Wincompatible-function-pointer-types-strict]
1070 | COUNTER_COMP_POLARITY(quad8_polarity_read, quad8_polarity_write,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1071 | quad8_polarity_available),
| ~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/counter.h:615:21: note: expanded from macro 'COUNTER_COMP_POLARITY'
615 | .signal_u32_read = (_read), \
| ^~~~~~~
drivers/counter/104-quad-8.c:1070:2: error: incompatible function pointer types initializing 'int (*)(struct counter_device *, struct counter_signal *, u32)' (aka 'int (*)(struct counter_device *, struct counter_signal *, unsigned int)') with an expression of type 'int (struct counter_device *, struct counter_signal *, enum counter_signal_polarity)' [-Werror,-Wincompatible-function-pointer-types-strict]
1070 | COUNTER_COMP_POLARITY(quad8_polarity_read, quad8_polarity_write,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1071 | quad8_polarity_available),
| ~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/counter.h:616:22: note: expanded from macro 'COUNTER_COMP_POLARITY'
616 | .signal_u32_write = (_write), \
| ^~~~~~~~
drivers/counter/104-quad-8.c:1158:2: error: incompatible function pointer types initializing 'int (*)(struct counter_device *, struct counter_count *, u32 *)' (aka 'int (*)(struct counter_device *, struct counter_count *, unsigned int *)') with an expression of type 'int (struct counter_device *, struct counter_count *, enum counter_count_mode *)' [-Werror,-Wincompatible-function-pointer-types-strict]
1158 | COUNTER_COMP_COUNT_MODE(quad8_count_mode_read, quad8_count_mode_write,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1159 | quad8_count_mode_available),
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/counter.h:590:20: note: expanded from macro 'COUNTER_COMP_COUNT_MODE'
590 | .count_u32_read = (_read), \
| ^~~~~~~
drivers/counter/104-quad-8.c:1158:2: error: incompatible function pointer types initializing 'int (*)(struct counter_device *, struct counter_count *, u32)' (aka 'int (*)(struct counter_device *, struct counter_count *, unsigned int)') with an expression of type 'int (struct counter_device *, struct counter_count *, enum counter_count_mode)' [-Werror,-Wincompatible-function-pointer-types-strict]
1158 | COUNTER_COMP_COUNT_MODE(quad8_count_mode_read, quad8_count_mode_write,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1159 | quad8_count_mode_available),
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/counter.h:591:21: note: expanded from macro 'COUNTER_COMP_COUNT_MODE'
591 | .count_u32_write = (_write), \
| ^~~~~~~~
drivers/counter/104-quad-8.c:1160:2: error: incompatible function pointer types initializing 'int (*)(struct counter_device *, struct counter_count *, u32 *)' (aka 'int (*)(struct counter_device *, struct counter_count *, unsigned int *)') with an expression of type 'int (struct counter_device *, struct counter_count *, enum counter_count_direction *)' [-Werror,-Wincompatible-function-pointer-types-strict]
1160 | COUNTER_COMP_DIRECTION(quad8_direction_read),
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/counter.h:599:20: note: expanded from macro 'COUNTER_COMP_DIRECTION'
599 | .count_u32_read = (_read), \
| ^~~~~~~
5 errors generated.
make[6]: *** [scripts/Makefile.build:287: drivers/counter/104-quad-8.o] Error 1
drivers/counter/ti-ecap-capture.c:384:2: error: incompatible function pointer types initializing 'int (*)(struct counter_device *, struct counter_signal *, size_t, u32 *)' (aka 'int (*)(struct counter_device *, struct counter_signal *, unsigned long, unsigned int *)') with an expression of type 'int (struct counter_device *, struct counter_signal *, size_t, enum counter_signal_polarity *)' (aka 'int (struct counter_device *, struct counter_signal *, unsigned long, enum counter_signal_polarity *)') [-Werror,-Wincompatible-function-pointer-types-strict]
384 | COUNTER_COMP_ARRAY_POLARITY(ecap_cnt_pol_read, ecap_cnt_pol_write, ecap_cnt_pol_array),
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/counter.h:633:27: note: expanded from macro 'COUNTER_COMP_ARRAY_POLARITY'
633 | .signal_array_u32_read = (_read), \
| ^~~~~~~
drivers/counter/ti-ecap-capture.c:384:2: error: incompatible function pointer types initializing 'int (*)(struct counter_device *, struct counter_signal *, size_t, u32)' (aka 'int (*)(struct counter_device *, struct counter_signal *, unsigned long, unsigned int)') with an expression of type 'int (struct counter_device *, struct counter_signal *, size_t, enum counter_signal_polarity)' (aka 'int (struct counter_device *, struct counter_signal *, unsigned long, enum counter_signal_polarity)') [-Werror,-Wincompatible-function-pointer-types-strict]
384 | COUNTER_COMP_ARRAY_POLARITY(ecap_cnt_pol_read, ecap_cnt_pol_write, ecap_cnt_pol_array),
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/counter.h:634:28: note: expanded from macro 'COUNTER_COMP_ARRAY_POLARITY'
634 | .signal_array_u32_write = (_write), \
| ^~~~~~~~
2 errors generated.
I had previously submitted a series to address these but the maintainer was not happy with it (somewhat understandably): https://lore.kernel.org/llvm/20221102172217.2860740-1-nathan@kernel.org/
This is the final set of warnings from -Wincompatible-function-pointer-types-strict in the tree in my builds before we can turn this on by default, which would be great to do so I can stop being the only one who finds and fixes these problems :)
cc @kees
Metadata
Metadata
Assignees
Labels
-Wincompatible-function-pointer-types-strict[BUG] linuxA bug that should be fixed in the mainline kernel.A bug that should be fixed in the mainline kernel.[PATCH] RejectedThe submitted patch was rejectedThe submitted patch was rejected