* [PATCH] alpha: Fix condition 'i>40' is always false
@ 2024-12-04 8:40 liujing
2024-12-04 14:33 ` Markus Elfring
0 siblings, 1 reply; 2+ messages in thread
From: liujing @ 2024-12-04 8:40 UTC (permalink / raw)
To: richard.henderson, ink, mattst88, paulmck, arnd
Cc: linux-alpha, linux-kernel, liujing
The i variable is used to count the number of stack frames printed,
but it is initialized to 0 only at the beginning of the loop, and
is not increased later in the loop. Therefore, the value of i is
always 0, resulting in the condition if (i > 40) never being true.
To ensure that i counts correctly, you need to increase the value
of i each time the stack frame is successfully printed.
Signed-off-by: liujing <liujing@cmss.chinamobile.com>
diff --git a/arch/alpha/kernel/traps.c b/arch/alpha/kernel/traps.c
index 6afae65e9a8b..65c44756f949 100644
--- a/arch/alpha/kernel/traps.c
+++ b/arch/alpha/kernel/traps.c
@@ -100,6 +100,7 @@ dik_show_trace(unsigned long *sp, const char *loglvl)
if (!is_kernel_text(tmp))
continue;
printk("%s[<%lx>] %pSR\n", loglvl, tmp, (void *)tmp);
+ i++;
if (i > 40) {
printk("%s ...", loglvl);
break;
--
2.27.0
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] alpha: Fix condition 'i>40' is always false
2024-12-04 8:40 [PATCH] alpha: Fix condition 'i>40' is always false liujing
@ 2024-12-04 14:33 ` Markus Elfring
0 siblings, 0 replies; 2+ messages in thread
From: Markus Elfring @ 2024-12-04 14:33 UTC (permalink / raw)
To: liujing, linux-alpha, Arnd Bergmann, Ivan Kokshaysky,
Matt Turner, Paul E. McKenney, Richard Henderson
Cc: LKML
…
> To ensure that i counts correctly, you need to increase the value
> of i each time the stack frame is successfully printed.
How do you think about to add any tags (like “Fixes” and “Cc”) accordingly?
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.13-rc1#n145
See also:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.13-rc1#n94
> Signed-off-by: liujing <liujing@cmss.chinamobile.com>
Under which circumstances may a personal name deviate from an email identifier?
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.13-rc1#n436
Regards,
Markus
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-12-04 14:33 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-12-04 8:40 [PATCH] alpha: Fix condition 'i>40' is always false liujing
2024-12-04 14:33 ` Markus Elfring
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®