diff options
author | Gustavo A. R. Silva <gustavoars@kernel.org> | 2022-11-08 21:26:47 +0100 |
---|---|---|
committer | Kalle Valo <kvalo@kernel.org> | 2022-11-16 10:31:47 +0100 |
commit | ff7efc66b7ea7bd2e575b3d56e24628b2f418315 (patch) | |
tree | 73a2be4daca32392388eb3b6b472bcd381ff5585 /fs/netfs | |
parent | wifi: hostap: Avoid clashing function prototypes (diff) | |
download | linux-ff7efc66b7ea7bd2e575b3d56e24628b2f418315.tar.xz linux-ff7efc66b7ea7bd2e575b3d56e24628b2f418315.zip |
wifi: zd1201: Avoid clashing function prototypes
When built with Control Flow Integrity, function prototypes between
caller and function declaration must match. These mismatches are visible
at compile time with the new -Wcast-function-type-strict in Clang[1].
Fix a total of 30 warnings like these:
../drivers/net/wireless/zydas/zd1201.c:1560:2: warning: cast from 'int (*)(struct net_device *, struct iw_request_info *, struct iw_freq *, char *)' to 'iw_handler' (aka 'int (*)(struct net_device *, struct iw_request_info *, union iwreq_data *, char *)') converts to incompatible function type [-Wcast-function-type-strict]
(iw_handler) zd1201_set_freq, /* SIOCSIWFREQ */
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
The zd1201 Wireless Extension handler callbacks (iw_handler) use a
union for the data argument. Actually use the union and perform explicit
member selection in the function body instead of having a function
prototype mismatch.There are no resulting binary differences
before/after changes.
These changes were made partly manually and partly with the help of
Coccinelle.
Link: https://github.com/KSPP/linux/issues/233
Link: https://reviews.llvm.org/D134831 [1]
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/5b7fbb1a22d5bfaa872263ca20297de9b431d1ec.1667934775.git.gustavoars@kernel.org
Diffstat (limited to 'fs/netfs')
0 files changed, 0 insertions, 0 deletions