lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1480706540-21323-1-git-send-email-fabf@skynet.be>
Date:   Fri,  2 Dec 2016 20:22:20 +0100
From:   Fabian Frederick <fabf@...net.be>
To:     Dan Williams <dan.j.williams@...el.com>
Cc:     linux-nvdimm@...ts.01.org, linux-kernel@...r.kernel.org,
        fabf@...net.be
Subject: [PATCH 8/8 linux-next] mm: use SECTION_MASK where possible

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,
-- 
2.7.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ