From: Ye Weihua yeweihua4@huawei.com
hulk inclusion category: bugfix bugzilla: 181325 https://gitee.com/openeuler/kernel/issues/I4DDEL
--------------------------------
An error is reported during version building: error: ISO C90 forbids mixed declarations and code.
Fix it by moving the variable definition forward.
Signed-off-by: Ye Weihua yeweihua4@huawei.com Reviewed-by: Yang Jihong yangjihong1@huawei.com Signed-off-by: Chen Jun chenjun102@huawei.com --- arch/arm/kernel/livepatch.c | 9 ++++----- arch/arm64/kernel/livepatch.c | 11 +++++------ arch/powerpc/kernel/livepatch_32.c | 9 ++++----- 3 files changed, 13 insertions(+), 16 deletions(-)
diff --git a/arch/arm/kernel/livepatch.c b/arch/arm/kernel/livepatch.c index f0bb09aa14b7..1ec326706a7b 100644 --- a/arch/arm/kernel/livepatch.c +++ b/arch/arm/kernel/livepatch.c @@ -298,15 +298,14 @@ int klp_check_calltrace(struct klp_patch *patch, int enable) int ret = 0; struct klp_func_list *nojump_funcs = NULL; struct klp_func_list *other_funcs = NULL; + struct walk_stackframe_args args = { + .ret = 0 + };
ret = klp_check_activeness_func(patch, enable, &nojump_funcs, &other_funcs); if (ret) goto out; - - struct walk_stackframe_args args = { - .other_funcs = other_funcs, - .ret = 0 - }; + args.other_funcs = other_funcs;
for_each_process_thread(g, t) { if (t == current) { diff --git a/arch/arm64/kernel/livepatch.c b/arch/arm64/kernel/livepatch.c index 650f457ab656..2ffbdfbe87de 100644 --- a/arch/arm64/kernel/livepatch.c +++ b/arch/arm64/kernel/livepatch.c @@ -291,17 +291,16 @@ int klp_check_calltrace(struct klp_patch *patch, int enable) int ret = 0; struct klp_func_list *nojump_funcs = NULL; struct klp_func_list *other_funcs = NULL; - - ret = klp_check_activeness_func(patch, enable, &nojump_funcs, &other_funcs); - if (ret) - goto out; - struct walk_stackframe_args args = { .enable = enable, - .other_funcs = other_funcs, .ret = 0 };
+ ret = klp_check_activeness_func(patch, enable, &nojump_funcs, &other_funcs); + if (ret) + goto out; + args.other_funcs = other_funcs; + for_each_process_thread(g, t) { /* * Handle the current carefully on each CPUs, we shouldn't diff --git a/arch/powerpc/kernel/livepatch_32.c b/arch/powerpc/kernel/livepatch_32.c index d22c44edc7c7..ea153f52e9ad 100644 --- a/arch/powerpc/kernel/livepatch_32.c +++ b/arch/powerpc/kernel/livepatch_32.c @@ -316,15 +316,14 @@ int klp_check_calltrace(struct klp_patch *patch, int enable) int ret = 0; struct klp_func_list *nojump_funcs = NULL; struct klp_func_list *other_funcs = NULL; + struct walk_stackframe_args args = { + .ret = 0 + };
ret = klp_check_activeness_func(patch, enable, &nojump_funcs, &other_funcs); if (ret) goto out; - - struct walk_stackframe_args args = { - .other_funcs = other_funcs, - .ret = 0 - }; + args.other_funcs = other_funcs;
for_each_process_thread(g, t) { if (t == current) {