From: Shiji Yang yangshiji66@outlook.com
[ Upstream commit 844615dd0f2d95c018ec66b943e08af22b62aff3 ]
These functions are exported but their prototypes are not defined. This patch adds the missing function prototypes to fix the following compilation warnings:
arch/mips/kernel/vpe-mt.c:180:7: error: no previous prototype for 'vpe_alloc' [-Werror=missing-prototypes] 180 | void *vpe_alloc(void) | ^~~~~~~~~ arch/mips/kernel/vpe-mt.c:198:5: error: no previous prototype for 'vpe_start' [-Werror=missing-prototypes] 198 | int vpe_start(void *vpe, unsigned long start) | ^~~~~~~~~ arch/mips/kernel/vpe-mt.c:208:5: error: no previous prototype for 'vpe_stop' [-Werror=missing-prototypes] 208 | int vpe_stop(void *vpe) | ^~~~~~~~ arch/mips/kernel/vpe-mt.c:229:5: error: no previous prototype for 'vpe_free' [-Werror=missing-prototypes] 229 | int vpe_free(void *vpe) | ^~~~~~~~
Signed-off-by: Shiji Yang yangshiji66@outlook.com Signed-off-by: Thomas Bogendoerfer tsbogend@alpha.franken.de Signed-off-by: Sasha Levin sashal@kernel.org ---
LLM Generated explanations, may be completely bogus:
Based on my analysis, here is my assessment:
**Backport Status: YES**
This commit is suitable for backporting to stable kernel trees for the following reasons:
1. **Fixes a compilation warning/error**: The commit addresses missing function prototype warnings that can cause build failures when compiling with `-Werror=missing-prototypes`. This is a build fix that prevents compilation issues.
2. **Minimal and contained change**: The patch only adds function prototypes to a header file (`arch/mips/include/asm/vpe.h`). It doesn't modify any actual implementation code, making it extremely low-risk.
3. **No functional changes**: The functions (`vpe_alloc`, `vpe_start`, `vpe_stop`, `vpe_free`) already exist and are exported via `EXPORT_SYMBOL()` in `arch/mips/kernel/vpe-mt.c`. The patch merely adds the missing declarations to the header file.
4. **Properly guarded with CONFIG**: The prototypes are correctly wrapped with `#ifdef CONFIG_MIPS_VPE_LOADER_MT`, matching the build configuration where these functions are compiled.
5. **Clear bug fix**: This addresses a specific issue where exported functions lack proper prototypes, which violates C standards and causes legitimate compiler warnings. The functions are already being exported (lines 192, 202, 223, 258 in vpe-mt.c show `EXPORT_SYMBOL` calls) but their prototypes were missing from the header.
6. **No risk of regression**: Since this only adds function declarations that match existing function definitions, there's virtually no risk of introducing new bugs or changing behavior.
7. **Follows stable kernel rules**: This is a clear bug fix (missing prototypes for exported symbols) that is self-contained and doesn't introduce new features or architectural changes.
The commit fixes a legitimate issue where functions are exported for use by other modules but their prototypes aren't declared in the header file, which can lead to build failures and potential issues with function signature mismatches.
arch/mips/include/asm/vpe.h | 8 ++++++++ 1 file changed, 8 insertions(+)
diff --git a/arch/mips/include/asm/vpe.h b/arch/mips/include/asm/vpe.h index 61fd4d0aeda4..c0769dc4b853 100644 --- a/arch/mips/include/asm/vpe.h +++ b/arch/mips/include/asm/vpe.h @@ -119,4 +119,12 @@ void cleanup_tc(struct tc *tc);
int __init vpe_module_init(void); void __exit vpe_module_exit(void); + +#ifdef CONFIG_MIPS_VPE_LOADER_MT +void *vpe_alloc(void); +int vpe_start(void *vpe, unsigned long start); +int vpe_stop(void *vpe); +int vpe_free(void *vpe); +#endif /* CONFIG_MIPS_VPE_LOADER_MT */ + #endif /* _ASM_VPE_H */