Commit 18279b46 authored by Ross Zwisler's avatar Ross Zwisler Committed by Dan Williams

pmem: remove layer when calling arch_has_wmb_pmem()

Prior to this change arch_has_wmb_pmem() was only called by
arch_has_pmem_api().  Both arch_has_wmb_pmem() and arch_has_pmem_api()
checked to make sure that CONFIG_ARCH_HAS_PMEM_API was enabled.

Instead, remove the old arch_has_wmb_pmem() wrapper to be rid of one
extra layer of indirection and the redundant CONFIG_ARCH_HAS_PMEM_API
check. Rename __arch_has_wmb_pmem() to arch_has_wmb_pmem() since we no
longer have a wrapper, and just have arch_has_pmem_api() call the
architecture specific arch_has_wmb_pmem() directly.
Signed-off-by: default avatarRoss Zwisler <ross.zwisler@linux.intel.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
parent 40603526
...@@ -67,7 +67,7 @@ static inline void arch_wmb_pmem(void) ...@@ -67,7 +67,7 @@ static inline void arch_wmb_pmem(void)
pcommit_sfence(); pcommit_sfence();
} }
static inline bool __arch_has_wmb_pmem(void) static inline bool arch_has_wmb_pmem(void)
{ {
#ifdef CONFIG_X86_64 #ifdef CONFIG_X86_64
/* /*
......
...@@ -23,7 +23,7 @@ static inline void arch_wmb_pmem(void) ...@@ -23,7 +23,7 @@ static inline void arch_wmb_pmem(void)
BUG(); BUG();
} }
static inline bool __arch_has_wmb_pmem(void) static inline bool arch_has_wmb_pmem(void)
{ {
return false; return false;
} }
...@@ -38,7 +38,7 @@ static inline void arch_memcpy_to_pmem(void __pmem *dst, const void *src, ...@@ -38,7 +38,7 @@ static inline void arch_memcpy_to_pmem(void __pmem *dst, const void *src,
/* /*
* Architectures that define ARCH_HAS_PMEM_API must provide * Architectures that define ARCH_HAS_PMEM_API must provide
* implementations for arch_memcpy_to_pmem(), arch_wmb_pmem(), and * implementations for arch_memcpy_to_pmem(), arch_wmb_pmem(), and
* __arch_has_wmb_pmem(). * arch_has_wmb_pmem().
*/ */
static inline void memcpy_from_pmem(void *dst, void __pmem const *src, size_t size) static inline void memcpy_from_pmem(void *dst, void __pmem const *src, size_t size)
...@@ -52,7 +52,7 @@ static inline void memunmap_pmem(struct device *dev, void __pmem *addr) ...@@ -52,7 +52,7 @@ static inline void memunmap_pmem(struct device *dev, void __pmem *addr)
} }
/** /**
* arch_has_wmb_pmem - true if wmb_pmem() ensures durability * arch_has_pmem_api - true if wmb_pmem() ensures durability
* *
* For a given cpu implementation within an architecture it is possible * For a given cpu implementation within an architecture it is possible
* that wmb_pmem() resolves to a nop. In the case this returns * that wmb_pmem() resolves to a nop. In the case this returns
...@@ -60,13 +60,6 @@ static inline void memunmap_pmem(struct device *dev, void __pmem *addr) ...@@ -60,13 +60,6 @@ static inline void memunmap_pmem(struct device *dev, void __pmem *addr)
* fall back to a different data consistency model, or otherwise notify * fall back to a different data consistency model, or otherwise notify
* the user. * the user.
*/ */
static inline bool arch_has_wmb_pmem(void)
{
if (IS_ENABLED(CONFIG_ARCH_HAS_PMEM_API))
return __arch_has_wmb_pmem();
return false;
}
static inline bool arch_has_pmem_api(void) static inline bool arch_has_pmem_api(void)
{ {
return IS_ENABLED(CONFIG_ARCH_HAS_PMEM_API) && arch_has_wmb_pmem(); return IS_ENABLED(CONFIG_ARCH_HAS_PMEM_API) && arch_has_wmb_pmem();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment