[PATCH 2/2] panic: Fix up description of vpanic()

Nam Cao posted 2 patches 2 months, 3 weeks ago
[PATCH 2/2] panic: Fix up description of vpanic()
Posted by Nam Cao 2 months, 3 weeks ago
The description above vpanic() has the wrong function name. Fix it up.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Closes: https://lore.kernel.org/lkml/20250711183802.2d8c124d@canb.auug.org.au/
Signed-off-by: Nam Cao <namcao@linutronix.de>
---
 kernel/panic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/panic.c b/kernel/panic.c
index 6a1823c383d0..2a499facde13 100644
--- a/kernel/panic.c
+++ b/kernel/panic.c
@@ -307,7 +307,7 @@ static void panic_other_cpus_shutdown(bool crash_kexec)
 }
 
 /**
- * panic - halt the system
+ * vpanic - halt the system
  * @fmt: The text string to print
  * @args: Arguments for the format string
  *
-- 
2.39.5
Re: [PATCH 2/2] panic: Fix up description of vpanic()
Posted by Masami Hiramatsu (Google) 2 months, 3 weeks ago
On Fri, 11 Jul 2025 13:20:43 +0200
Nam Cao <namcao@linutronix.de> wrote:

> The description above vpanic() has the wrong function name. Fix it up.
> 
> Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
> Closes: https://lore.kernel.org/lkml/20250711183802.2d8c124d@canb.auug.org.au/
> Signed-off-by: Nam Cao <namcao@linutronix.de>
> ---
>  kernel/panic.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/kernel/panic.c b/kernel/panic.c
> index 6a1823c383d0..2a499facde13 100644
> --- a/kernel/panic.c
> +++ b/kernel/panic.c
> @@ -307,7 +307,7 @@ static void panic_other_cpus_shutdown(bool crash_kexec)
>  }
>  
>  /**
> - * panic - halt the system
> + * vpanic - halt the system

Shouldn't we make a copy the doc for the panic() (keep the text as it is)
and change the short explanation?

panic - halt the system
@fmt: ...

vpanic - halt the system with va_list
@fmt: ...
@args: ...

 From the newbie's viewpoint, as far as we keep providing the same
function, it is better to keep the same document to avoid confusion.

Thanks,


>   * @fmt: The text string to print
>   * @args: Arguments for the format string
>   *
> -- 
> 2.39.5
> 


-- 
Masami Hiramatsu (Google) <mhiramat@kernel.org>
Re: [PATCH 2/2] panic: Fix up description of vpanic()
Posted by Nam Cao 2 months, 3 weeks ago
On Tue, Jul 15, 2025 at 02:56:01PM +0900, Masami Hiramatsu wrote:
> On Fri, 11 Jul 2025 13:20:43 +0200
> Nam Cao <namcao@linutronix.de> wrote:
> >  /**
> > - * panic - halt the system
> > + * vpanic - halt the system
> 
> Shouldn't we make a copy the doc for the panic() (keep the text as it is)
> and change the short explanation?
> 
> panic - halt the system
> @fmt: ...
> 
> vpanic - halt the system with va_list
> @fmt: ...
> @args: ...
> 
>  From the newbie's viewpoint, as far as we keep providing the same
> function, it is better to keep the same document to avoid confusion.

That would be nice for sure. But I think the counter arguments are
stronger:

  - Two copies need to be maintained

  - panic() is only a few lines, and it is obvious at first glance that it
    is simply a thin wrapper around vpanic()

So I think it is better to leave it as is.

Best regards,
Nam