From f58f63c4b3d2bb193b566b9905314b378bf7ca67 Mon Sep 17 00:00:00 2001 From: Igor Velkov <325961+iav@users.noreply.github.com> Date: Sun, 16 Aug 2026 16:42:29 +0300 Subject: [PATCH 1/2] rtw_recv: drop the dead pkt/rxmem recv-frame helpers rxmem_to_recvframe(), pkt_to_recvframe(), pkt_to_recvmem() and pkt_to_recvdata() have no callers, and pkt_to_recvframe() returns a value derived from a local that is never assigned (clang -Wuninitialized on every translation unit that includes the header). Remove them. --- include/rtw_recv.h | 41 ----------------------------------------- 1 file changed, 41 deletions(-) diff --git a/include/rtw_recv.h b/include/rtw_recv.h index 1673b04..e680a5d 100644 --- a/include/rtw_recv.h +++ b/include/rtw_recv.h @@ -759,47 +759,6 @@ __inline static u8 *recvframe_pull_tail(union recv_frame *precvframe, sint sz) } -__inline static union recv_frame *rxmem_to_recvframe(u8 *rxmem) -{ - /* due to the design of 2048 bytes alignment of recv_frame, we can reference the union recv_frame */ - /* from any given member of recv_frame. */ - /* rxmem indicates the any member/address in recv_frame */ - - return (union recv_frame *)(((SIZE_PTR)rxmem >> RXFRAME_ALIGN) << RXFRAME_ALIGN); - -} - -__inline static union recv_frame *pkt_to_recvframe(_pkt *pkt) -{ - - u8 *buf_star; - union recv_frame *precv_frame; - precv_frame = rxmem_to_recvframe((unsigned char *)buf_star); - - return precv_frame; -} - -__inline static u8 *pkt_to_recvmem(_pkt *pkt) -{ - /* return the rx_head */ - - union recv_frame *precv_frame = pkt_to_recvframe(pkt); - - return precv_frame->u.hdr.rx_head; - -} - -__inline static u8 *pkt_to_recvdata(_pkt *pkt) -{ - /* return the rx_data */ - - union recv_frame *precv_frame = pkt_to_recvframe(pkt); - - return precv_frame->u.hdr.rx_data; - -} - - __inline static sint get_recvframe_len(union recv_frame *precvframe) { return precvframe->u.hdr.len; From f35e1a7356f5fc210e242fd8189fc06c3775bd96 Mon Sep 17 00:00:00 2001 From: Igor Velkov <325961+iav@users.noreply.github.com> Date: Sun, 16 Aug 2026 16:42:46 +0300 Subject: [PATCH 2/2] hal_halmac: warn about DPK status only when it is neither DONE nor ERROR status != DONE || status != ERROR is always true, so every completed DPK command logged "unexpected status". Use && as the sibling cases do. --- hal/hal_halmac.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hal/hal_halmac.c b/hal/hal_halmac.c index c198f11..449dd9d 100644 --- a/hal/hal_halmac.c +++ b/hal/hal_halmac.c @@ -628,7 +628,7 @@ static inline u8 is_valid_id_status(enum halmac_feature_id id, enum halmac_cmd_p if (status == HALMAC_CMD_PROCESS_RCVD) return _FALSE; if ((status != HALMAC_CMD_PROCESS_DONE) - || (status != HALMAC_CMD_PROCESS_ERROR)) + && (status != HALMAC_CMD_PROCESS_ERROR)) RTW_WARN("%s: %s unexpected status(0x%x)!\n", __FUNCTION__, RTW_HALMAC_FEATURE_NAME[id], status);