[RFC V2 01/14] mm: Abstract printing of pxd_val()
David Laight
david.laight.linux at gmail.com
Thu May 21 02:42:06 PDT 2026
On Tue, 19 May 2026 07:28:17 -0700
Dave Hansen <dave.hansen at intel.com> wrote:
> On 5/12/26 21:45, Anshuman Khandual wrote:
> > if (!p4d_present(p4d) || p4d_leaf(p4d)) {
> > - pr_alert("pgd:%08llx p4d:%08llx\n", pgdv, p4dv);
> > + pr_alert("pgd:%" __PRIpxx " p4d:%" __PRIpxx "\n",
> > + __PRIpxx_args(pgdv), __PRIpxx_args(p4dv));
> > return;
> > }
>
> That's not the most readable result. Could a printk() format specifier
> make this nicer? Maybe use "%pT"?
>
> pr_alert("pgd:%pT p4d:%pT\n", &pgd, &p4d);
>
> I _think_ it could even get rid of the p??v variables.
>
Adding another %p variant that is only used in a few places just makes
it all harder to read.
Perhaps a local helper that lets you do:
char pdgv_buf[??]:
pr_alert("... %s ...", ... fmt_pdgv(pdgv_buf, pdgv) ...)
might be a reasonable compromise.
-- David
More information about the linux-arm-kernel
mailing list