-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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 unused function warnings #83830
Draft
thughes
wants to merge
23
commits into
zephyrproject-rtos:main
Choose a base branch
from
thughes:fix-unused-function-warnings
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Fix unused function warnings #83830
thughes
wants to merge
23
commits into
zephyrproject-rtos:main
from
thughes:fix-unused-function-warnings
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: Tom Hughes <[email protected]>
Building with clang warns: subsys/net/ip/ipv6_nbr.c:137:31: error: unused function 'get_nbr_from_data' [-Werror,-Wunused-function] static inline struct net_nbr *get_nbr_from_data(struct net_ipv6_nbr_data *data) ^ Signed-off-by: Tom Hughes <[email protected]>
Building with clang warns: subsys/net/ip/net_pkt.c:496:34: error: unused function 'get_tx_slab' [-Werror,-Wunused-function] static inline struct k_mem_slab *get_tx_slab(struct net_context *context) ^ Signed-off-by: Tom Hughes <[email protected]>
Building with clang warns: subsys/net/lib/coap/coap_link_format.c:39:20: error: unused function 'append_be16' [-Werror,-Wunused-function] static inline bool append_be16(struct coap_packet *cpkt, uint16_t data) Signed-off-by: Tom Hughes <[email protected]>
Building with clang warns: subsys/net/lib/http/http_hpack.c:21:20: error: unused function 'http_hpack_key_is_dynamic' [-Werror,-Wunused-function] static inline bool http_hpack_key_is_dynamic(uint32_t key) ^ Signed-off-by: Tom Hughes <[email protected]>
Building with clang warns: drivers/modem/modem_cmd_handler.c:102:31: error: unused function 'read_rx_allocator' [-Werror,-Wunused-function] static inline struct net_buf *read_rx_allocator(k_timeout_t timeout, ^ Signed-off-by: Tom Hughes <[email protected]>
Building with clang warns: drivers/sensor/st/iis2iclx/iis2iclx.c:68:19: error: unused function 'iis2iclx_reboot' [-Werror,-Wunused-function] static inline int iis2iclx_reboot(const struct device *dev) ^ Signed-off-by: Tom Hughes <[email protected]>
Building with clang warns: drivers/sensor/st/ism330dhcx/ism330dhcx.c:107:19: error: unused function 'ism330dhcx_reboot' [-Werror,-Wunused-function] static inline int ism330dhcx_reboot(const struct device *dev) Signed-off-by: Tom Hughes <[email protected]>
Building with clang warns: drivers/sensor/st/lsm9ds0_mfd/lsm9ds0_mfd.c:42:19: error: unused function 'lsm9ds0_mfd_accel_set_odr_raw' [-Werror,-Wunused-function] static inline int lsm9ds0_mfd_accel_set_odr_raw(const struct device *dev, ^ lsm9ds0_mfd_accel_set_odr_raw only used by code that was guarded by defined(CONFIG_LSM9DS0_MFD_ACCEL_SAMPLING_RATE_RUNTIME) in addition to !defined(LSM9DS0_MFD_ACCEL_DISABLED). Signed-off-by: Tom Hughes <[email protected]>
Building with clang warns: drivers/sensor/st/lsm6dso/lsm6dso.c:89:19: error: unused function 'lsm6dso_reboot' [-Werror,-Wunused-function] static inline int lsm6dso_reboot(const struct device *dev) ^ Signed-off-by: Tom Hughes <[email protected]>
Building with clang warns: drivers/sensor/st/lsm6dso16is/lsm6dso16is.c:83:19: error: unused function 'lsm6dso16is_reboot' [-Werror,-Wunused-function] static inline int lsm6dso16is_reboot(const struct device *dev) ^ Signed-off-by: Tom Hughes <[email protected]>
Building with clang warns: zephyr/drivers/sensor/st/lis2dw12/lis2dw12.c:194:23: error: unused function 'sensor_ms2_to_mg' [-Werror,-Wunused-function] static inline int32_t sensor_ms2_to_mg(const struct sensor_value *ms2) ^ sensor_ms2_to_mg is only called when (ONFIG_LIS2DW12_SLEEP or CONFIG_LIS2DW12_WAKEUP is defined. Signed-off-by: Tom Hughes <[email protected]>
Building with clang warns: drivers/gpio/gpio_pca95xx.c:256:19: error: unused function 'update_input_reg' [-Werror,-Wunused-function] static inline int update_input_reg(const struct device *dev, uint8_t pin, ^ Signed-off-by: Tom Hughes <[email protected]>
Building with clang warns: drivers/gpio/gpio_pca95xx.c:256:19: error: unused function 'update_input_reg' [-Werror,-Wunused-function] static inline int update_input_reg(const struct device *dev, uint8_t pin, ^ Signed-off-by: Tom Hughes <[email protected]>
Building with clang warns: drivers/flash/spi_nor.c:306:20: error: unused function 'delay_until_exit_dpd_ok' [-Werror,-Wunused-function] static inline void delay_until_exit_dpd_ok(const struct device *const dev) ^ delay_until_exit_dpd_ok is only used when ANY_INST_HAS_DPD is defined. Signed-off-by: Tom Hughes <[email protected]>
Building with clang warns: drivers/dma/dma_emul.c:73:20: error: unused function 'dma_emul_xfer_is_error_status' [-Werror,-Wunused-function] static inline bool dma_emul_xfer_is_error_status(int status) ^ Signed-off-by: Tom Hughes <[email protected]>
Building with clang warns: tests/posix/timers/src/clock.c:37:20: error: unused function 'tv_to_ts' [-Werror,-Wunused-function] static inline void tv_to_ts(const struct timeval *tv, struct timespec *ts) ^ tests/posix/timers/src/clock.c:51:16: error: unused function 'tp_eq' [-Werror,-Wunused-function] _decl_op(bool, tp_eq, ==); /* a == b */ ^ tests/posix/timers/src/clock.c:52:16: error: unused function 'tp_lt' [-Werror,-Wunused-function] _decl_op(bool, tp_lt, <); /* a < b */ ^ tests/posix/timers/src/clock.c:53:16: error: unused function 'tp_gt' [-Werror,-Wunused-function] _decl_op(bool, tp_gt, >); /* a > b */ ^ tests/posix/timers/src/clock.c:54:16: error: unused function 'tp_le' [-Werror,-Wunused-function] _decl_op(bool, tp_le, <=); /* a <= b */ tests/posix/timers/src/clock.c:59:20: error: unused function 'tp_diff_in_range_ns' [-Werror,-Wunused-function] static inline bool tp_diff_in_range_ns(const struct timespec *a, const struct timespec *b, ^ Signed-off-by: Tom Hughes <[email protected]>
Building with clang warns: tests/net/udp/src/main.c:112:31: error: unused function 'if_get_addr' [-Werror,-Wunused-function] static inline struct in_addr *if_get_addr(struct net_if *iface) ^ Signed-off-by: Tom Hughes <[email protected]>
Building with clang warns: subsys/net/ip/utils.c:600:24: error: unused function 'pkt_calc_chksum' [-Werror,-Wunused-function] static inline uint16_t pkt_calc_chksum(struct net_pkt *pkt, uint16_t sum) ^ pkt_calc_chksum is called by net_calc_chksum, which only exists when CONFIG_NET_NATIVE_IP is defined. Signed-off-by: Tom Hughes <[email protected]>
Building with clang warns: tests/net/arp/src/main.c:152:31: error: unused function 'if_get_addr' [-Werror,-Wunused-function] static inline struct in_addr *if_get_addr(struct net_if *iface) ^ Signed-off-by: Tom Hughes <[email protected]>
Building with clang warns: drivers/gpio/gpio_pca95xx.c:120:12: error: unused function 'read_port_reg' [-Werror,-Wunused-function] static int read_port_reg(const struct device *dev, uint8_t reg, uint8_t pin, ^ Signed-off-by: Tom Hughes <[email protected]>
Building with clang warns: tests/posix/timers/src/clock.c:49:20: error: unused function 'tp_diff_in_range_ns' [-Werror,-Wunused-function] static inline bool tp_diff_in_range_ns(const struct timespec *a, const struct timespec *b, ^ Signed-off-by: Tom Hughes <[email protected]>
Building with clang warns: tests/net/shell/src/main.c:110:31: error: unused function 'if_get_addr' [-Werror,-Wunused-function] static inline struct in_addr *if_get_addr(struct net_if *iface) ^ Signed-off-by: Tom Hughes <[email protected]>
thughes
force-pushed
the
fix-unused-function-warnings
branch
from
January 10, 2025 22:05
a07bb9e
to
671f6d3
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Re-enable the
-Wunused-function
warning when building withclang
. Unlikegcc
,clang
generates warnings before optimizations, so it catches more.