Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c4544205 authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Dan Williams
Browse files

nvdimm: use 'u64' for pfn flags



A recent bugfix changed pfn_t to always be 64-bit wide, but did not
change the code in pmem.c, which is now broken on 32-bit architectures
as reported by gcc:

In file included from ../drivers/nvdimm/pmem.c:28:0:
drivers/nvdimm/pmem.c: In function 'pmem_alloc':
include/linux/pfn_t.h:15:17: error: large integer implicitly truncated to unsigned type [-Werror=overflow]
 #define PFN_DEV (1ULL << (BITS_PER_LONG_LONG - 3))

This changes the intermediate pfn_flags in struct pmem_device to
be 64 bit wide as well, so they can store the flags correctly.

Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Fixes: db78c222 ("mm: fix pfn_t vs highmem")
Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
parent 93f834df
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -41,7 +41,7 @@ struct pmem_device {
	phys_addr_t		phys_addr;
	/* when non-zero this device is hosting a 'pfn' instance */
	phys_addr_t		data_offset;
	unsigned long		pfn_flags;
	u64			pfn_flags;
	void __pmem		*virt_addr;
	size_t			size;
	struct badblocks	bb;