linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm/oom_kill: Remove unnecessary integer promotion in format string
@ 2025-12-28 15:44 Dipendra Khadka
  2025-12-29  3:52 ` David Rientjes
  2025-12-29  8:27 ` Michal Hocko
  0 siblings, 2 replies; 5+ messages in thread
From: Dipendra Khadka @ 2025-12-28 15:44 UTC (permalink / raw)
  To: Michal Hocko, Andrew Morton
  Cc: David Rientjes, Shakeel Butt, linux-mm, linux-kernel, Dipendra Khadka

The 'h' length modifier in '%hd' is unnecessary as short integers are
promoted to int in variadic functions. Use '%d' instead.

Signed-off-by: Dipendra Khadka <kdipendra88@gmail.com>
---
 mm/oom_kill.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/mm/oom_kill.c b/mm/oom_kill.c
index 5eb11fbba704..94066316e3ec 100644
--- a/mm/oom_kill.c
+++ b/mm/oom_kill.c
@@ -458,7 +458,7 @@ static void dump_oom_victim(struct oom_control *oc, struct task_struct *victim)
 
 static void dump_header(struct oom_control *oc)
 {
-	pr_warn("%s invoked oom-killer: gfp_mask=%#x(%pGg), order=%d, oom_score_adj=%hd\n",
+	pr_warn("%s invoked oom-killer: gfp_mask=%#x(%pGg), order=%d, oom_score_adj=%d\n",
 		current->comm, oc->gfp_mask, &oc->gfp_mask, oc->order,
 			current->signal->oom_score_adj);
 	if (!IS_ENABLED(CONFIG_COMPACTION) && oc->order)
@@ -958,7 +958,7 @@ static void __oom_kill_process(struct task_struct *victim, const char *message)
 	 */
 	do_send_sig_info(SIGKILL, SEND_SIG_PRIV, victim, PIDTYPE_TGID);
 	mark_oom_victim(victim);
-	pr_err("%s: Killed process %d (%s) total-vm:%lukB, anon-rss:%lukB, file-rss:%lukB, shmem-rss:%lukB, UID:%u pgtables:%lukB oom_score_adj:%hd\n",
+	pr_err("%s: Killed process %d (%s) total-vm:%lukB, anon-rss:%lukB, file-rss:%lukB, shmem-rss:%lukB, UID:%u pgtables:%lukB oom_score_adj:%d\n",
 		message, task_pid_nr(victim), victim->comm, K(mm->total_vm),
 		K(get_mm_counter(mm, MM_ANONPAGES)),
 		K(get_mm_counter(mm, MM_FILEPAGES)),
-- 
2.43.0



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-12-31 12:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-12-28 15:44 [PATCH] mm/oom_kill: Remove unnecessary integer promotion in format string Dipendra Khadka
2025-12-29  3:52 ` David Rientjes
2025-12-29  8:27 ` Michal Hocko
2025-12-30 20:33   ` Andrew Morton
2025-12-31 12:21     ` Dipendra Khadka

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox