* [PATCH 2/9] fbdev: Use panic_in_progress() helper
[not found] ` <20250820091702.512524-2-wangjinchao600@gmail.com>
@ 2025-08-20 9:14 ` Jinchao Wang
2025-08-20 10:44 ` Qianqiang Liu
0 siblings, 1 reply; 2+ messages in thread
From: Jinchao Wang @ 2025-08-20 9:14 UTC (permalink / raw)
To: pmladek, akpm, Simona Vetter, Helge Deller, Thomas Zimmermann,
Ville Syrjälä, Qianqiang Liu, Shixiong Ou, Jinchao Wang,
Sravan Kumar Gundu, Zsolt Kajtar, Kees Cook
Cc: linux-kernel, feng.tang, joel.granados, john.ogness, namcao,
linux-fbdev, dri-devel
This patch updates the fbcon_skip_panic() function to use
the panic_in_progress() helper.
The previous direct access to panic_cpu is less
readable and is being replaced by a dedicated function
that more clearly expresses the intent.
This change is part of a series to refactor the kernel's
panic handling logic for better clarity and robustness.
Signed-off-by: Jinchao Wang <wangjinchao600@gmail.com>
---
drivers/video/fbdev/core/fbcon.c | 9 +--------
1 file changed, 1 insertion(+), 8 deletions(-)
diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c
index 55f5731e94c3..b062b05f4128 100644
--- a/drivers/video/fbdev/core/fbcon.c
+++ b/drivers/video/fbdev/core/fbcon.c
@@ -279,14 +279,7 @@ static int fbcon_get_rotate(struct fb_info *info)
static bool fbcon_skip_panic(struct fb_info *info)
{
-/* panic_cpu is not exported, and can't be used if built as module. Use
- * oops_in_progress instead, but non-fatal oops won't be printed.
- */
-#if defined(MODULE)
- return (info->skip_panic && unlikely(oops_in_progress));
-#else
- return (info->skip_panic && unlikely(atomic_read(&panic_cpu) != PANIC_CPU_INVALID));
-#endif
+ return (info->skip_panic && unlikely(panic_in_progress()));
}
static inline bool fbcon_is_active(struct vc_data *vc, struct fb_info *info)
--
2.43.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 2/9] fbdev: Use panic_in_progress() helper
2025-08-20 9:14 ` [PATCH 2/9] fbdev: Use panic_in_progress() helper Jinchao Wang
@ 2025-08-20 10:44 ` Qianqiang Liu
0 siblings, 0 replies; 2+ messages in thread
From: Qianqiang Liu @ 2025-08-20 10:44 UTC (permalink / raw)
To: Jinchao Wang
Cc: pmladek, akpm, Simona Vetter, Helge Deller, Thomas Zimmermann,
Ville Syrjälä, Shixiong Ou, Sravan Kumar Gundu,
Zsolt Kajtar, Kees Cook, linux-kernel, feng.tang, joel.granados,
john.ogness, namcao, linux-fbdev, dri-devel
On Wed, Aug 20, 2025 at 05:14:47PM +0800, Jinchao Wang wrote:
> This patch updates the fbcon_skip_panic() function to use
> the panic_in_progress() helper.
>
> The previous direct access to panic_cpu is less
> readable and is being replaced by a dedicated function
> that more clearly expresses the intent.
>
> This change is part of a series to refactor the kernel's
> panic handling logic for better clarity and robustness.
>
> Signed-off-by: Jinchao Wang <wangjinchao600@gmail.com>
> ---
> drivers/video/fbdev/core/fbcon.c | 9 +--------
> 1 file changed, 1 insertion(+), 8 deletions(-)
>
> diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c
> index 55f5731e94c3..b062b05f4128 100644
> --- a/drivers/video/fbdev/core/fbcon.c
> +++ b/drivers/video/fbdev/core/fbcon.c
> @@ -279,14 +279,7 @@ static int fbcon_get_rotate(struct fb_info *info)
>
> static bool fbcon_skip_panic(struct fb_info *info)
> {
> -/* panic_cpu is not exported, and can't be used if built as module. Use
> - * oops_in_progress instead, but non-fatal oops won't be printed.
> - */
> -#if defined(MODULE)
> - return (info->skip_panic && unlikely(oops_in_progress));
> -#else
> - return (info->skip_panic && unlikely(atomic_read(&panic_cpu) != PANIC_CPU_INVALID));
> -#endif
> + return (info->skip_panic && unlikely(panic_in_progress()));
> }
>
> static inline bool fbcon_is_active(struct vc_data *vc, struct fb_info *info)
> --
> 2.43.0
Acked-by Qianqiang Liu <qianqiang.liu@163.com>
--
Best,
Qianqiang Liu
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-08-20 10:45 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20250820091702.512524-1-wangjinchao600@gmail.com>
[not found] ` <20250820091702.512524-2-wangjinchao600@gmail.com>
2025-08-20 9:14 ` [PATCH 2/9] fbdev: Use panic_in_progress() helper Jinchao Wang
2025-08-20 10:44 ` Qianqiang Liu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox