[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180704130500.GP22503@dhcp22.suse.cz>
Date: Wed, 4 Jul 2018 15:05:00 +0200
From: Michal Hocko <mhocko@...nel.org>
To: Mike Rapoport <rppt@...ux.vnet.ibm.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
linux-mm <linux-mm@...ck.org>,
lkml <linux-kernel@...r.kernel.org>,
Matthew Wilcox <willy@...radead.org>
Subject: Re: [PATCH] mm/memblock: replace u64 with phys_addr_t where
appropriate
On Tue 03-07-18 20:05:06, Mike Rapoport wrote:
> Most functions in memblock already use phys_addr_t to represent a physical
> address with __memblock_free_late() being an exception.
>
> This patch replaces u64 with phys_addr_t in __memblock_free_late() and
> switches several format strings from %llx to %pa to avoid casting from
> phys_addr_t to u64.
>
> CC: Michal Hocko <mhocko@...nel.org>
> CC: Matthew Wilcox <willy@...radead.org>
> Signed-off-by: Mike Rapoport <rppt@...ux.vnet.ibm.com>
> ---
> mm/memblock.c | 46 +++++++++++++++++++++++-----------------------
> 1 file changed, 23 insertions(+), 23 deletions(-)
>
> diff --git a/mm/memblock.c b/mm/memblock.c
> index 03d48d8..20ad8e9 100644
> --- a/mm/memblock.c
> +++ b/mm/memblock.c
> @@ -330,7 +330,7 @@ static int __init_memblock memblock_double_array(struct memblock_type *type,
> {
> struct memblock_region *new_array, *old_array;
> phys_addr_t old_alloc_size, new_alloc_size;
> - phys_addr_t old_size, new_size, addr;
> + phys_addr_t old_size, new_size, addr, new_end;
> int use_slab = slab_is_available();
> int *in_slab;
>
> @@ -391,9 +391,9 @@ static int __init_memblock memblock_double_array(struct memblock_type *type,
> return -1;
> }
>
> - memblock_dbg("memblock: %s is doubled to %ld at [%#010llx-%#010llx]",
> - type->name, type->max * 2, (u64)addr,
> - (u64)addr + new_size - 1);
> + new_end = addr + new_size - 1;
> + memblock_dbg("memblock: %s is doubled to %ld at [%pa-%pa]",
> + type->name, type->max * 2, &addr, &new_end);
I didn't get to check this carefully but this surely looks suspicious. I
am pretty sure you wanted to print the value here rather than address of
the local variable, right?
--
Michal Hocko
SUSE Labs
Powered by blists - more mailing lists