[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAPcyv4g81fyw5GZuuARRB70upYy7Q1GPM+P9cKd6kfH12fKUbA@mail.gmail.com>
Date: Fri, 2 Dec 2016 11:54:22 -0800
From: Dan Williams <dan.j.williams@...el.com>
To: Fabian Frederick <fabf@...net.be>
Cc: "linux-nvdimm@...ts.01.org" <linux-nvdimm@...ts.01.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 8/8 linux-next] mm: use SECTION_MASK where possible
On Fri, Dec 2, 2016 at 11:22 AM, Fabian Frederick <fabf@...net.be> wrote:
> Signed-off-by: Fabian Frederick <fabf@...net.be>
> ---
> kernel/memremap.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/kernel/memremap.c b/kernel/memremap.c
> index 1bb5eec..8ebf9dd 100644
> --- a/kernel/memremap.c
> +++ b/kernel/memremap.c
> @@ -198,7 +198,7 @@ static void pgmap_radix_release(struct resource *res)
> {
> resource_size_t key, align_start, align_size, align_end;
>
> - align_start = res->start & ~(SECTION_SIZE - 1);
> + align_start = res->start & SECTION_MASK;
> align_size = ALIGN(resource_size(res), SECTION_SIZE);
> align_end = align_start + align_size - 1;
>
> @@ -244,7 +244,7 @@ static void devm_memremap_pages_release(struct device *dev, void *data)
> }
>
> /* pages are dead and unused, undo the arch mapping */
> - align_start = res->start & ~(SECTION_SIZE - 1);
> + align_start = res->start & SECTION_MASK;
> align_size = ALIGN(resource_size(res), SECTION_SIZE);
> arch_remove_memory(align_start, align_size);
> untrack_pfn(NULL, PHYS_PFN(align_start), align_size);
> @@ -289,7 +289,7 @@ void *devm_memremap_pages(struct device *dev, struct resource *res,
> int error, nid, is_ram;
> unsigned long pfn;
>
> - align_start = res->start & ~(SECTION_SIZE - 1);
> + align_start = res->start & SECTION_MASK;
> align_size = ALIGN(res->start + resource_size(res), SECTION_SIZE)
> - align_start;
> is_ram = region_intersects(align_start, align_size,
This is addressed in the sub-section hotplug series:
"[PATCH 03/11] mm: introduce common definitions for the size and mask
of a section"
https://lkml.org/lkml/2016/12/1/746
Powered by blists - more mailing lists