*
  * Can be used to provide arguments for '%*pb[l]' when printing a nodemask.
  */
-#define nodemask_pr_args(maskp)                MAX_NUMNODES, (maskp)->bits
+#define nodemask_pr_args(maskp)                                \
+       ((maskp) != NULL) ? MAX_NUMNODES : 0,           \
+       ((maskp) != NULL) ? (maskp)->bits : NULL
 
 /*
  * The inline keyword gives the compiler room to decide to inline, or
 
 
 static void dump_header(struct oom_control *oc, struct task_struct *p)
 {
-       pr_warn("%s invoked oom-killer: gfp_mask=%#x(%pGg), nodemask=",
-               current->comm, oc->gfp_mask, &oc->gfp_mask);
-       if (oc->nodemask)
-               pr_cont("%*pbl", nodemask_pr_args(oc->nodemask));
-       else
-               pr_cont("(null)");
-       pr_cont(",  order=%d, oom_score_adj=%hd\n",
-               oc->order, current->signal->oom_score_adj);
+       pr_warn("%s invoked oom-killer: gfp_mask=%#x(%pGg), nodemask=%*pbl, order=%d, oom_score_adj=%hd\n",
+               current->comm, oc->gfp_mask, &oc->gfp_mask,
+               nodemask_pr_args(oc->nodemask), oc->order,
+                       current->signal->oom_score_adj);
        if (!IS_ENABLED(CONFIG_COMPACTION) && oc->order)
                pr_warn("COMPACTION is disabled!!!\n");
 
 
        if ((gfp_mask & __GFP_NOWARN) || !__ratelimit(&nopage_rs))
                return;
 
-       pr_warn("%s: ", current->comm);
-
        va_start(args, fmt);
        vaf.fmt = fmt;
        vaf.va = &args;
-       pr_cont("%pV", &vaf);
+       pr_warn("%s: %pV, mode:%#x(%pGg), nodemask=%*pbl\n",
+                       current->comm, &vaf, gfp_mask, &gfp_mask,
+                       nodemask_pr_args(nodemask));
        va_end(args);
 
-       pr_cont(", mode:%#x(%pGg), nodemask=", gfp_mask, &gfp_mask);
-       if (nodemask)
-               pr_cont("%*pbl\n", nodemask_pr_args(nodemask));
-       else
-               pr_cont("(null)\n");
-
        cpuset_print_current_mems_allowed();
 
        dump_stack();