Skip to content

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

Open
iav wants to merge 7 commits into
Mange:realtek-4.4.xfrom
iav:fix-wmissing-prototypes
Open

Fix -Wmissing-prototypes warnings across all source files#366
iav wants to merge 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 added 7 commits July 3, 2026 02:11
…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 ba8d469 to 8dae771 Compare July 2, 2026 23:14
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.

1 participant