* [PATCH v1] mm/early_remap: Use %pa to print resource_size_t variables
@ 2019-12-09 16:54 Andy Shevchenko
2019-12-09 17:33 ` David Hildenbrand
0 siblings, 1 reply; 2+ messages in thread
From: Andy Shevchenko @ 2019-12-09 16:54 UTC (permalink / raw)
To: Andrew Morton, linux-mm; +Cc: Andy Shevchenko
%pa takes into consideration the special types such as resource_size_t.
Use this specifier %instead of explicit casting.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
mm/early_ioremap.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/mm/early_ioremap.c b/mm/early_ioremap.c
index 1826f191e72c..a0018ad1a1f6 100644
--- a/mm/early_ioremap.c
+++ b/mm/early_ioremap.c
@@ -121,8 +121,8 @@ __early_ioremap(resource_size_t phys_addr, unsigned long size, pgprot_t prot)
}
}
- if (WARN(slot < 0, "%s(%08llx, %08lx) not found slot\n",
- __func__, (u64)phys_addr, size))
+ if (WARN(slot < 0, "%s(%pa, %08lx) not found slot\n",
+ __func__, &phys_addr, size))
return NULL;
/* Don't allow wraparound or zero size */
@@ -158,8 +158,8 @@ __early_ioremap(resource_size_t phys_addr, unsigned long size, pgprot_t prot)
--idx;
--nrpages;
}
- WARN(early_ioremap_debug, "%s(%08llx, %08lx) [%d] => %08lx + %08lx\n",
- __func__, (u64)phys_addr, size, slot, offset, slot_virt[slot]);
+ WARN(early_ioremap_debug, "%s(%pa, %08lx) [%d] => %08lx + %08lx\n",
+ __func__, &phys_addr, size, slot, offset, slot_virt[slot]);
prev_map[slot] = (void __iomem *)(offset + slot_virt[slot]);
return prev_map[slot];
--
2.24.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v1] mm/early_remap: Use %pa to print resource_size_t variables
2019-12-09 16:54 [PATCH v1] mm/early_remap: Use %pa to print resource_size_t variables Andy Shevchenko
@ 2019-12-09 17:33 ` David Hildenbrand
0 siblings, 0 replies; 2+ messages in thread
From: David Hildenbrand @ 2019-12-09 17:33 UTC (permalink / raw)
To: Andy Shevchenko, Andrew Morton, linux-mm
On 09.12.19 17:54, Andy Shevchenko wrote:
> %pa takes into consideration the special types such as resource_size_t.
> Use this specifier %instead of explicit casting.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
> mm/early_ioremap.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/mm/early_ioremap.c b/mm/early_ioremap.c
> index 1826f191e72c..a0018ad1a1f6 100644
> --- a/mm/early_ioremap.c
> +++ b/mm/early_ioremap.c
> @@ -121,8 +121,8 @@ __early_ioremap(resource_size_t phys_addr, unsigned long size, pgprot_t prot)
> }
> }
>
> - if (WARN(slot < 0, "%s(%08llx, %08lx) not found slot\n",
> - __func__, (u64)phys_addr, size))
> + if (WARN(slot < 0, "%s(%pa, %08lx) not found slot\n",
> + __func__, &phys_addr, size))
> return NULL;
>
> /* Don't allow wraparound or zero size */
> @@ -158,8 +158,8 @@ __early_ioremap(resource_size_t phys_addr, unsigned long size, pgprot_t prot)
> --idx;
> --nrpages;
> }
> - WARN(early_ioremap_debug, "%s(%08llx, %08lx) [%d] => %08lx + %08lx\n",
> - __func__, (u64)phys_addr, size, slot, offset, slot_virt[slot]);
> + WARN(early_ioremap_debug, "%s(%pa, %08lx) [%d] => %08lx + %08lx\n",
> + __func__, &phys_addr, size, slot, offset, slot_virt[slot]);
>
> prev_map[slot] = (void __iomem *)(offset + slot_virt[slot]);
> return prev_map[slot];
>
Yes, that's what Documentation/core-api/printk-formats.rst wants us to do :)
Reviewed-by: David Hildenbrand <david@redhat.com>
--
Thanks,
David / dhildenb
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-12-09 17:33 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-09 16:54 [PATCH v1] mm/early_remap: Use %pa to print resource_size_t variables Andy Shevchenko
2019-12-09 17:33 ` David Hildenbrand
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.