Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

hangcheck-timer: replace printk(KERN_CRIT) with pr_crit

Replace printk(KERN_CRIT ...) with pr_crit(...) and printk() with
pr_debug(). The change aims to make logging more consistent and
readable.

Signed-off-by: Clint George <clintbgeorge@gmail.com>
Link: https://patch.msgid.link/20251111151340.9162-2-clintbgeorge@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Clint George and committed by
Greg Kroah-Hartman
75d19e36 3397c3cd

+6 -6
+6 -6
drivers/char/hangcheck-timer.c
··· 126 126 127 127 if (tsc_diff > hangcheck_tsc_margin) { 128 128 if (hangcheck_dump_tasks) { 129 - printk(KERN_CRIT "Hangcheck: Task state:\n"); 129 + pr_crit("Hangcheck: Task state:\n"); 130 130 #ifdef CONFIG_MAGIC_SYSRQ 131 131 handle_sysrq('t'); 132 132 #endif /* CONFIG_MAGIC_SYSRQ */ 133 133 } 134 134 if (hangcheck_reboot) { 135 - printk(KERN_CRIT "Hangcheck: hangcheck is restarting the machine.\n"); 135 + pr_crit("Hangcheck: hangcheck is restarting the machine.\n"); 136 136 emergency_restart(); 137 137 } else { 138 - printk(KERN_CRIT "Hangcheck: hangcheck value past margin!\n"); 138 + pr_crit("Hangcheck: hangcheck value past margin!\n"); 139 139 } 140 140 } 141 141 #if 0 142 142 /* 143 143 * Enable to investigate delays in detail 144 144 */ 145 - printk("Hangcheck: called %Ld ns since last time (%Ld ns overshoot)\n", 145 + pr_debug("Hangcheck: called %Ld ns since last time (%Ld ns overshoot)\n", 146 146 tsc_diff, tsc_diff - hangcheck_tick*TIMER_FREQ); 147 147 #endif 148 148 mod_timer(&hangcheck_ticktock, jiffies + (hangcheck_tick*HZ)); ··· 152 152 153 153 static int __init hangcheck_init(void) 154 154 { 155 - printk("Hangcheck: starting hangcheck timer %s (tick is %d seconds, margin is %d seconds).\n", 155 + pr_debug("Hangcheck: starting hangcheck timer %s (tick is %d seconds, margin is %d seconds).\n", 156 156 VERSION_STR, hangcheck_tick, hangcheck_margin); 157 157 hangcheck_tsc_margin = 158 158 (unsigned long long)hangcheck_margin + hangcheck_tick; ··· 168 168 static void __exit hangcheck_exit(void) 169 169 { 170 170 timer_delete_sync(&hangcheck_ticktock); 171 - printk("Hangcheck: Stopped hangcheck timer.\n"); 171 + pr_debug("Hangcheck: Stopped hangcheck timer.\n"); 172 172 } 173 173 174 174 module_init(hangcheck_init);