Skip to content

[finsh] Remove deprecated FINSH_FUNCTION_EXPORT_ALIAS - #11734

Open
BernardXiong wants to merge 3 commits into
RT-Thread:masterfrom
BernardXiong:fix/pr-10940-finsh-export-alias
Open

[finsh] Remove deprecated FINSH_FUNCTION_EXPORT_ALIAS#11734
BernardXiong wants to merge 3 commits into
RT-Thread:masterfrom
BernardXiong:fix/pr-10940-finsh-export-alias

Conversation

@BernardXiong

Copy link
Copy Markdown
Member

Summary

  • Remove the deprecated FINSH_FUNCTION_EXPORT_ALIAS definitions and all remaining call sites.
  • Keep existing MSH command exports and migrate compatible Allwinner handlers to MSH_CMD_EXPORT_ALIAS.
  • Remove stale conditional blocks and update the related driver changelog text.

Fixes #10814 and follows up on #10940.

Validation

  • Confirmed no FINSH_FUNCTION_EXPORT_ALIAS references remain.
  • Changed lines pass clang-format checks.
  • Simulator compilation reaches link stage; local linking requires SDL2.

@CLAassistant

CLAassistant commented Aug 23, 2026

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ BernardXiong
❌ Copilot
You have signed the CLA already but the status is still pending? Let us recheck it.

@github-actions

Copy link
Copy Markdown

👋 感谢您对 RT-Thread 的贡献!Thank you for your contribution to RT-Thread!

为确保代码符合 RT-Thread 的编码规范,请在你的仓库中执行以下步骤运行代码格式化工作流(如果格式化CI运行失败)。
To ensure your code complies with RT-Thread's coding style, please run the code formatting workflow by following the steps below (If the formatting of CI fails to run).


🛠 操作步骤 | Steps

  1. 前往 Actions 页面 | Go to the Actions page
    点击进入工作流 → | Click to open workflow →

  2. 点击 Run workflow | Click Run workflow

  • Use workflow from 保持默认分支(通常为 master
    Keep the default branch (usually master) in Use workflow from
  • branch 输入框填写 PR 分支 fix/pr-10940-finsh-export-alias
    Enter PR branch fix/pr-10940-finsh-export-alias in the branch field
  • 设置需排除的文件/目录(目录请以"/"结尾)
    Set files/directories to exclude (directories should end with "/")
  1. 等待工作流完成 | Wait for the workflow to complete
    格式化后的代码将作为独立提交推送至你的分支。
    The formatting changes will be pushed to your branch as a separate commit.

完成后,提交将自动更新至 fix/pr-10940-finsh-export-alias 分支,关联的 Pull Request 也会同步更新。
Once completed, commits will be pushed to the fix/pr-10940-finsh-export-alias branch automatically, and the related Pull Request will be updated.

如有问题欢迎联系我们,再次感谢您的贡献!💐
If you have any questions, feel free to reach out. Thanks again for your contribution!

@github-actions

github-actions Bot commented Aug 23, 2026

Copy link
Copy Markdown

📌 Code Review Assignment

🏷️ Tag: components

Reviewers: @Maihuanyi

Changed Files (Click to expand)
  • components/dfs/dfs_v1/src/dfs_posix.c
  • components/dfs/dfs_v2/src/dfs_posix.c
  • components/drivers/mtd/mtd_nand.c
  • components/drivers/pm/pm.c
  • components/finsh/finsh.h

🏷️ Tag: components_driver_pm

Reviewers: @wdfk-prog

Changed Files (Click to expand)
  • components/drivers/pm/pm.c

📊 Current Review Status (Last Updated: 2026-08-24 00:09 CST)


📝 Review Instructions

  1. 维护者可以通过单击此处来刷新审查状态: 🔄 刷新状态
    Maintainers can refresh the review status by clicking here: 🔄 Refresh Status

  2. 确认审核通过后评论 LGTM/lgtm
    Comment LGTM/lgtm after confirming approval

  3. PR合并前需至少一位维护者确认
    PR must be confirmed by at least one maintainer before merging

ℹ️ 刷新CI状态操作需要具备仓库写入权限。
ℹ️ Refresh CI status operation requires repository Write permission.

Remove the obsolete alias macro and stale call sites.

Export compatible Allwinner command handlers through MSH_CMD_EXPORT_ALIAS.
@BernardXiong
BernardXiong force-pushed the fix/pr-10940-finsh-export-alias branch from 41df276 to 5211867 Compare August 23, 2026 05:00
@github-actions

github-actions Bot commented Aug 23, 2026

Copy link
Copy Markdown

@BernardXiong
BernardXiong requested a balanced review from Copilot August 23, 2026 05:56
@BernardXiong BernardXiong added the 🎯 Focus Should focus on this issue/discussion/pr label Aug 23, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Removes the deprecated no-op FINSH_FUNCTION_EXPORT_ALIAS API and migrates compatible Allwinner display handlers to MSH commands. / 移除已废弃的空操作 API,并将兼容的 Allwinner 显示处理函数迁移为 MSH 命令。

Changes:

  • Removed macro definitions and stale call sites. / 移除宏定义及遗留调用。
  • Migrated compatible display handlers to MSH_CMD_EXPORT_ALIAS. / 迁移兼容的显示命令。
  • Updated related cleanup code and changelog text. / 更新相关清理代码及变更记录。

Reviewed changes

Copilot reviewed 19 out of 19 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
include/rtdef.h Removes fallback alias macro. / 移除后备别名宏。
components/finsh/finsh.h Removes deprecated public macro. / 移除废弃公开宏。
components/drivers/pm/pm.c Removes redundant PM alias export. / 移除冗余 PM 导出。
components/drivers/mtd/mtd_nand.c Removes obsolete NAND aliases. / 移除旧 NAND 别名。
components/dfs/dfs_v2/src/dfs_posix.c Removes obsolete cd alias. / 移除旧 cd 别名。
components/dfs/dfs_v1/src/dfs_posix.c Removes obsolete cd alias. / 移除旧 cd 别名。
bsp/simulator/drivers/module_win32.c Removes stale export block. / 移除过时导出块。
bsp/simulator/drivers/board.c Removes exit alias; includes unrelated initialization edit. / 移除退出别名,并包含无关初始化改动。
bsp/fujitsu/mb9x/mb9bf506r/drivers/nand.c Removes obsolete debug aliases. / 移除旧调试别名。
bsp/at91/at91sam9260/platform/reset.c Removes redundant reset alias. / 移除冗余复位别名。
bsp/apm32/libraries/Drivers/drv_common.c Updates changelog wording. / 更新变更记录措辞。
bsp/allwinner/libraries/sunxi-hal/hal/test/disp2/disp_mem.c Exports memory command and adds null handling. / 导出内存命令并增加空值处理。
bsp/allwinner/libraries/sunxi-hal/hal/test/disp2/disp_lbc_test.c Migrates LBC command export. / 迁移 LBC 命令导出。
bsp/allwinner/libraries/sunxi-hal/hal/test/disp2/disp_layer_scal_test.c Migrates scaling-test export. / 迁移缩放测试导出。
bsp/allwinner/libraries/sunxi-hal/hal/test/disp2/disp_layer_rgb_test.c Migrates RGB-test export. / 迁移 RGB 测试导出。
bsp/allwinner/libraries/sunxi-hal/hal/test/disp2/disp_layer_format_test.c Migrates format-test export. / 迁移格式测试导出。
bsp/allwinner/libraries/sunxi-hal/hal/test/disp2/disp_layer_cfg.c Migrates layer configuration export. / 迁移图层配置导出。
bsp/allwinner/libraries/sunxi-hal/hal/test/disp2/disp_layer_alpha_test.c Migrates alpha-test export. / 迁移透明度测试导出。
bsp/allwinner/libraries/sunxi-hal/hal/source/disp2/disp/disp_debug.c Adapts and exports the display debug handler. / 调整并导出显示调试处理函数。

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

}

FINSH_FUNCTION_EXPORT_ALIAS(cmd_disp_debug, __cmd_disp, disp cmd);
MSH_CMD_EXPORT_ALIAS(cmd_disp_debug, __cmd_disp, disp cmd);

@BernardXiong BernardXiong Aug 23, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已处理,提交 83cb695-e 的 m/s/b/c/g/n/d 子命令现在要求两个参数,p 子命令要求一个参数;缺少参数时返回错误,避免访问越界的 argv。

Addressed in 83cb695: each enhancement subcommand now validates its required argument count before reading argv.

{
/* init system memory */
rt_hw_sram_init();
RT_UNUSED(rt_hw_sram_init());

@BernardXiong BernardXiong Aug 23, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已处理,提交 83cb695。已恢复原来的 rt_hw_sram_init(); 调用,移除了与本 PR 无关的 RT_UNUSED 改动。

Addressed in 83cb695: the unrelated simulator initialization change has been reverted.


FINSH_FUNCTION_EXPORT_ALIAS(parse_cmdline_and_alloc, disp_mem, disp mem);

MSH_CMD_EXPORT_ALIAS(parse_cmdline_and_alloc, disp_mem, disp mem);

@BernardXiong BernardXiong Aug 23, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已处理,提交 83cb695。文件名超过 31 字节时命令直接报错,复制使用有界的 rt_strncpy;mem_id 在解析器和底层内存操作入口均限制为 [0, 9],非法输入返回错误。

Addressed in 83cb695: bounded filename handling and mem_id validation now protect both the shell handler and direct API paths.

修复 disp 命令参数越界和内存命令输入校验问题,并恢复模拟器 SRAM 初始化调用。
整理受影响代码的 clang-format 排版,并显式消费模拟器 SRAM 初始化返回值以通过 cppcheck。
@BernardXiong

Copy link
Copy Markdown
Member Author

已补充修复并推送到 bernard/fix/pr-10940-finsh-export-alias:提交 0c3d241c43 按仓库 .clang-format 规则整理了受影响代码,并使用 RT_UNUSED(rt_hw_sram_init()) 消除了 cppcheck 的 leakReturnValNotUsed 报错。已在本地按 CI 文件集合验证 clang-format checktools/ci/cpp_check.py check 均通过,请重新运行 CI。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[clean] 清理仓库中残留 FINSH_FUNCTION_EXPORT_ALIAS 调用代码

4 participants