Skip to content

Fix -Wmissing-prototypes warnings across all source files - #366

Merged
CGarces merged 7 commits into
Mange:realtek-4.4.xfrom
iav:fix-wmissing-prototypes
Sep 5, 2026
Merged

CGarces merged 7 commits into
Mange:realtek-4.4.xfrom
iav:fix-wmissing-prototypes

Conversation

@iav

@iav iav commented Jun 11, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes all -Wmissing-prototypes warnings generated when building this driver
against Linux kernels that enable this warning globally (e.g. Armbian with
kernel 7.x).

Changes across 68 files:

  • Add static to ~121 functions used only within their translation unit
  • Add prototypes to appropriate headers for cross-file functions:
    • include/rtw_ioctl.h: rtw_indicate_wx_assoc_event,
      rtw_indicate_wx_disassoc_event, indicate_wx_scan_complete_event
    • include/rtl8192e_hal.h: UpdateInterruptMask8192EU
      (inside #ifdef CONFIG_USB_HCI)
    • hal/phydm/phydm_api.h: config_phydm_read_txagc_n
      (inside #ifndef PHYDM_COMMON_API_SUPPORT)
    • platform/platform_ops.h: include added to platform_ops.c
  • Add forward declarations in defining files for cross-file functions
    that lack a natural shared header:
    recvbuf2recvframe, netdev_br_init, pm_netdev_open,
    rtw_hw_suspend, rtw_hw_resume, rtw_resume_process,
    rtw_change_ifname, phydm_fw_fix_rate, record_ra_info,
    MgntQuery_NssTxRate
  • Remove redundant extern declarations from os_dep/linux/mlme_linux.c
    (now covered by rtw_ioctl.h)
  • Fix #ifdef CONFIG_BT_COEXIST_SOCKET_TRX block in core/rtw_btcoex.c
    (three functions were incorrectly outside the guard)
  • Normalize core/rtw_chplan.c from CRLF to LF

Tested: full kernel build with Armbian on rockchip64, no remaining
-Wmissing-prototypes warnings for this driver.

🤖 Generated with Claude Code


Commits are split by subsystem (core / os_dep / hal / phydm / rtl8192e) for independent review. Verified under x86_64 defconfig (which sets CONFIG_WERROR) on Linux 6.12.93: 0 -Wmissing-prototypes remaining — including 5 functions behind USB/kernel-version guards that only surface under a strict build config.

@iav

iav commented Jun 15, 2026

Copy link
Copy Markdown
Contributor Author

@CGarces

@iav
iav marked this pull request as draft June 18, 2026 15:50
@iav
iav force-pushed the fix-wmissing-prototypes branch from a3b096b to ba8d469 Compare June 18, 2026 16:42
@iav
iav marked this pull request as ready for review June 18, 2026 16:44
@iav
iav force-pushed the fix-wmissing-prototypes branch from ba8d469 to 8dae771 Compare July 2, 2026 23:14
iav added 7 commits September 5, 2026 01:59
…ired headers

Assisted-by: Claude:claude-opus-4.8
… headers

Assisted-by: Claude:claude-opus-4.8
Assisted-by: Claude:claude-opus-4.8
RF_DBG, PHYDM_DBG and DBG_COUNTER expand to nothing in their
debug-disabled branches, so call sites like `if (cond) RF_DBG(...);`
collapse to `if (cond) ;` and gcc reports -Wempty-body. Give those
empty branches a `do {} while (0)` body so they stay valid single
statements; a bare `{}` would break `if (...) MACRO(); else ...`
chains (dangling else). Also brace genuinely empty if-bodies.

Assisted-by: Claude:claude-opus-4.8
@iav
iav force-pushed the fix-wmissing-prototypes branch from 8dae771 to b041d52 Compare September 4, 2026 23:23
@CGarces

CGarces commented Sep 5, 2026

Copy link
Copy Markdown
Collaborator

Hi @iav
I don't have time to maintain this. but I'll try to merge this weekend.
I see that you still pushing commits.
It's ready to merge or your have work in progress?
Should be splitted on separate PR?

@iav

iav commented Sep 5, 2026

Copy link
Copy Markdown
Contributor Author

Ready to merge. Last night's push was only a rebase onto current realtek-4.4.x, no new work.
7 commits: 6 are the -Wmissing-prototypes fix split by subsystem for review; the last one fixes -Wempty-body in the phydm debug macros — I can move it to a separate PR if you prefer.
The 7.2/7.3 failures are not from this PR: kernel 7.2 dropped strncpy, and the base branch fails the same way at os_intfs.c:1455.
Want a separate one-line PR switching it to strscpy?

@iav iav mentioned this pull request Sep 5, 2026
@CGarces
CGarces merged commit 4efb9c6 into Mange:realtek-4.4.x Sep 5, 2026
8 of 10 checks passed
@iav
iav deleted the fix-wmissing-prototypes branch September 5, 2026 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants