diff options
| author | Ingo Molnar <mingo@kernel.org> | 2016-04-23 14:12:10 +0200 |
|---|---|---|
| committer | Ingo Molnar <mingo@kernel.org> | 2016-04-23 14:12:10 +0200 |
| commit | 65cbbd037b3d7be0a40bbdb5da9d43b0fccf17ee (patch) | |
| tree | 02b22c99008630010f28f45f502f55915f1014c2 /include/linux/pmem.h | |
| parent | 9243ae5b28d02dc7d71a4f00c981ef6feaede3f1 (diff) | |
| parent | b303e7c15d53cd8ef6b349b702e07eee3f102792 (diff) | |
| download | talos-op-linux-65cbbd037b3d7be0a40bbdb5da9d43b0fccf17ee.tar.gz talos-op-linux-65cbbd037b3d7be0a40bbdb5da9d43b0fccf17ee.zip | |
Merge branch 'perf/urgent' into perf/core, to resolve conflict
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'include/linux/pmem.h')
| -rw-r--r-- | include/linux/pmem.h | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/include/linux/pmem.h b/include/linux/pmem.h index ac6d872ce067..57d146fe44dd 100644 --- a/include/linux/pmem.h +++ b/include/linux/pmem.h @@ -72,6 +72,18 @@ static inline void arch_invalidate_pmem(void __pmem *addr, size_t size) } #endif +static inline bool arch_has_pmem_api(void) +{ + return IS_ENABLED(CONFIG_ARCH_HAS_PMEM_API); +} + +static inline int default_memcpy_from_pmem(void *dst, void __pmem const *src, + size_t size) +{ + memcpy(dst, (void __force *) src, size); + return 0; +} + /* * memcpy_from_pmem - read from persistent memory with error handling * @dst: destination buffer @@ -83,12 +95,10 @@ static inline void arch_invalidate_pmem(void __pmem *addr, size_t size) static inline int memcpy_from_pmem(void *dst, void __pmem const *src, size_t size) { - return arch_memcpy_from_pmem(dst, src, size); -} - -static inline bool arch_has_pmem_api(void) -{ - return IS_ENABLED(CONFIG_ARCH_HAS_PMEM_API); + if (arch_has_pmem_api()) + return arch_memcpy_from_pmem(dst, src, size); + else + return default_memcpy_from_pmem(dst, src, size); } /** |

