diff options
author | Nathan Chancellor <nathan@kernel.org> | 2023-10-02 13:55:20 -0700 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2023-10-04 17:15:04 -0700 |
commit | 26cc115d590c70e66d8399f39e4d9973d26439bc (patch) | |
tree | 369b140ee2e0e41e8fe4408d4932a3ecb3d7a3db /drivers/ptp | |
parent | 78cac6f17133d503add9005e891e15637b2a1012 (diff) | |
download | lwn-26cc115d590c70e66d8399f39e4d9973d26439bc.tar.gz lwn-26cc115d590c70e66d8399f39e4d9973d26439bc.zip |
ptp: Fix type of mode parameter in ptp_ocp_dpll_mode_get()
When building with -Wincompatible-function-pointer-types-strict, a
warning designed to catch potential kCFI failures at build time rather
than run time due to incorrect function pointer types, there is a
warning due to a mismatch between the type of the mode parameter in
ptp_ocp_dpll_mode_get() vs. what the function pointer prototype for
->mode_get() in 'struct dpll_device_ops' expects.
drivers/ptp/ptp_ocp.c:4353:14: error: incompatible function pointer types initializing 'int (*)(const struct dpll_device *, void *, enum dpll_mode *, struct netlink_ext_ack *)' with an expression of type 'int (const struct dpll_device *, void *, u32 *, struct netlink_ext_ack *)' (aka 'int (const struct dpll_device *, void *, unsigned int *, struct netlink_ext_ack *)') [-Werror,-Wincompatible-function-pointer-types-strict]
4353 | .mode_get = ptp_ocp_dpll_mode_get,
| ^~~~~~~~~~~~~~~~~~~~~
1 error generated.
Change the type of the mode parameter in ptp_ocp_dpll_mode_get() to
clear up the warning and avoid kCFI failures at run time.
Fixes: 09eeb3aecc6c ("ptp_ocp: implement DPLL ops")
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://lore.kernel.org/r/20231002-net-wifpts-dpll_mode_get-v1-1-a356a16413cf@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/ptp')
-rw-r--r-- | drivers/ptp/ptp_ocp.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/ptp/ptp_ocp.c b/drivers/ptp/ptp_ocp.c index d39afe091a7b..6835ffe88d43 100644 --- a/drivers/ptp/ptp_ocp.c +++ b/drivers/ptp/ptp_ocp.c @@ -4255,7 +4255,7 @@ static int ptp_ocp_dpll_state_get(const struct dpll_pin *pin, void *pin_priv, } static int ptp_ocp_dpll_mode_get(const struct dpll_device *dpll, void *priv, - u32 *mode, struct netlink_ext_ack *extack) + enum dpll_mode *mode, struct netlink_ext_ack *extack) { *mode = DPLL_MODE_AUTOMATIC; return 0; |