2023-05-10 09:22:45

by Rick Wertenbroek

[permalink] [raw]
Subject: [PATCH] mm: memory_hotplug: Fix format string in warnings

The format string in __add_pages and __remove_pages has a typo
and prints e.g., "Misaligned __add_pages start: 0xfc605 end: #fc609"
instead of "Misaligned __add_pages start: 0xfc605 end: 0xfc609"
Fix "#%lx" => "%#lx"

Signed-off-by: Rick Wertenbroek <[email protected]>
---
mm/memory_hotplug.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
index 8e0fa209d533..9061ac69b1b6 100644
--- a/mm/memory_hotplug.c
+++ b/mm/memory_hotplug.c
@@ -325,7 +325,7 @@ int __ref __add_pages(int nid, unsigned long pfn, unsigned long nr_pages,
}

if (check_pfn_span(pfn, nr_pages)) {
- WARN(1, "Misaligned %s start: %#lx end: #%lx\n", __func__, pfn, pfn + nr_pages - 1);
+ WARN(1, "Misaligned %s start: %#lx end: %#lx\n", __func__, pfn, pfn + nr_pages - 1);
return -EINVAL;
}

@@ -525,7 +525,7 @@ void __remove_pages(unsigned long pfn, unsigned long nr_pages,
map_offset = vmem_altmap_offset(altmap);

if (check_pfn_span(pfn, nr_pages)) {
- WARN(1, "Misaligned %s start: %#lx end: #%lx\n", __func__, pfn, pfn + nr_pages - 1);
+ WARN(1, "Misaligned %s start: %#lx end: %#lx\n", __func__, pfn, pfn + nr_pages - 1);
return;
}

--
2.25.1



2023-05-10 16:40:26

by David Hildenbrand

[permalink] [raw]
Subject: Re: [PATCH] mm: memory_hotplug: Fix format string in warnings

On 10.05.23 11:07, Rick Wertenbroek wrote:
> The format string in __add_pages and __remove_pages has a typo
> and prints e.g., "Misaligned __add_pages start: 0xfc605 end: #fc609"
> instead of "Misaligned __add_pages start: 0xfc605 end: 0xfc609"
> Fix "#%lx" => "%#lx"
>
> Signed-off-by: Rick Wertenbroek <[email protected]>
> ---
> mm/memory_hotplug.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
> index 8e0fa209d533..9061ac69b1b6 100644
> --- a/mm/memory_hotplug.c
> +++ b/mm/memory_hotplug.c
> @@ -325,7 +325,7 @@ int __ref __add_pages(int nid, unsigned long pfn, unsigned long nr_pages,
> }
>
> if (check_pfn_span(pfn, nr_pages)) {
> - WARN(1, "Misaligned %s start: %#lx end: #%lx\n", __func__, pfn, pfn + nr_pages - 1);
> + WARN(1, "Misaligned %s start: %#lx end: %#lx\n", __func__, pfn, pfn + nr_pages - 1);
> return -EINVAL;
> }
>
> @@ -525,7 +525,7 @@ void __remove_pages(unsigned long pfn, unsigned long nr_pages,
> map_offset = vmem_altmap_offset(altmap);
>
> if (check_pfn_span(pfn, nr_pages)) {
> - WARN(1, "Misaligned %s start: %#lx end: #%lx\n", __func__, pfn, pfn + nr_pages - 1);
> + WARN(1, "Misaligned %s start: %#lx end: %#lx\n", __func__, pfn, pfn + nr_pages - 1);
> return;
> }
>

Reviewed-by: David Hildenbrand <[email protected]>

--
Thanks,

David / dhildenb


2023-05-12 06:17:59

by Mike Rapoport

[permalink] [raw]
Subject: Re: [PATCH] mm: memory_hotplug: Fix format string in warnings

On Wed, May 10, 2023 at 11:07:57AM +0200, Rick Wertenbroek wrote:
> The format string in __add_pages and __remove_pages has a typo
> and prints e.g., "Misaligned __add_pages start: 0xfc605 end: #fc609"
> instead of "Misaligned __add_pages start: 0xfc605 end: 0xfc609"
> Fix "#%lx" => "%#lx"
>
> Signed-off-by: Rick Wertenbroek <[email protected]>

Reviewed-by: Mike Rapoport (IBM) <[email protected]>

> ---
> mm/memory_hotplug.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
> index 8e0fa209d533..9061ac69b1b6 100644
> --- a/mm/memory_hotplug.c
> +++ b/mm/memory_hotplug.c
> @@ -325,7 +325,7 @@ int __ref __add_pages(int nid, unsigned long pfn, unsigned long nr_pages,
> }
>
> if (check_pfn_span(pfn, nr_pages)) {
> - WARN(1, "Misaligned %s start: %#lx end: #%lx\n", __func__, pfn, pfn + nr_pages - 1);
> + WARN(1, "Misaligned %s start: %#lx end: %#lx\n", __func__, pfn, pfn + nr_pages - 1);
> return -EINVAL;
> }
>
> @@ -525,7 +525,7 @@ void __remove_pages(unsigned long pfn, unsigned long nr_pages,
> map_offset = vmem_altmap_offset(altmap);
>
> if (check_pfn_span(pfn, nr_pages)) {
> - WARN(1, "Misaligned %s start: %#lx end: #%lx\n", __func__, pfn, pfn + nr_pages - 1);
> + WARN(1, "Misaligned %s start: %#lx end: %#lx\n", __func__, pfn, pfn + nr_pages - 1);
> return;
> }
>
> --
> 2.25.1
>
>

--
Sincerely yours,
Mike.