Skip to content

Commit baf1ed2

Browse files
BenjaminGrayNp1mpe
authored andcommitted
powerpc/mm: Remove empty hash__ functions
The empty hash__* functions are unnecessary. The empty definitions were introduced when 64-bit Hash support was added, as the functions were still used in generic code. These empty definitions were prefixed with hash__ when Radix support was added, and new wrappers with the original names were added that selected the Radix or Hash version based on radix_enabled(). But the hash__ prefixed functions were not part of a public interface, so there is no need to include them for compatibility with anything. Generic code will use the non-prefixed wrappers, and Hash specific code will know that there is no point in calling them (or even worse, call them and expect them to do something). Signed-off-by: Benjamin Gray <[email protected]> Reviewed-by: Christophe Leroy <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 071c95c commit baf1ed2

File tree

2 files changed

+9
-46
lines changed

2 files changed

+9
-46
lines changed

arch/powerpc/include/asm/book3s/64/tlbflush-hash.h

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,6 @@ extern void flush_hash_range(unsigned long number, int local);
6565
extern void flush_hash_hugepage(unsigned long vsid, unsigned long addr,
6666
pmd_t *pmdp, unsigned int psize, int ssize,
6767
unsigned long flags);
68-
static inline void hash__local_flush_tlb_mm(struct mm_struct *mm)
69-
{
70-
}
71-
72-
static inline void hash__flush_tlb_mm(struct mm_struct *mm)
73-
{
74-
}
7568

7669
static inline void hash__local_flush_all_mm(struct mm_struct *mm)
7770
{
@@ -95,27 +88,6 @@ static inline void hash__flush_all_mm(struct mm_struct *mm)
9588
WARN_ON_ONCE(1);
9689
}
9790

98-
static inline void hash__local_flush_tlb_page(struct vm_area_struct *vma,
99-
unsigned long vmaddr)
100-
{
101-
}
102-
103-
static inline void hash__flush_tlb_page(struct vm_area_struct *vma,
104-
unsigned long vmaddr)
105-
{
106-
}
107-
108-
static inline void hash__flush_tlb_range(struct vm_area_struct *vma,
109-
unsigned long start, unsigned long end)
110-
{
111-
}
112-
113-
static inline void hash__flush_tlb_kernel_range(unsigned long start,
114-
unsigned long end)
115-
{
116-
}
117-
118-
11991
struct mmu_gather;
12092
extern void hash__tlb_flush(struct mmu_gather *tlb);
12193

arch/powerpc/include/asm/book3s/64/tlbflush.h

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,7 @@ static inline void flush_pmd_tlb_range(struct vm_area_struct *vma,
4747
unsigned long start, unsigned long end)
4848
{
4949
if (radix_enabled())
50-
return radix__flush_pmd_tlb_range(vma, start, end);
51-
return hash__flush_tlb_range(vma, start, end);
50+
radix__flush_pmd_tlb_range(vma, start, end);
5251
}
5352

5453
#define __HAVE_ARCH_FLUSH_HUGETLB_TLB_RANGE
@@ -57,39 +56,34 @@ static inline void flush_hugetlb_tlb_range(struct vm_area_struct *vma,
5756
unsigned long end)
5857
{
5958
if (radix_enabled())
60-
return radix__flush_hugetlb_tlb_range(vma, start, end);
61-
return hash__flush_tlb_range(vma, start, end);
59+
radix__flush_hugetlb_tlb_range(vma, start, end);
6260
}
6361

6462
static inline void flush_tlb_range(struct vm_area_struct *vma,
6563
unsigned long start, unsigned long end)
6664
{
6765
if (radix_enabled())
68-
return radix__flush_tlb_range(vma, start, end);
69-
return hash__flush_tlb_range(vma, start, end);
66+
radix__flush_tlb_range(vma, start, end);
7067
}
7168

7269
static inline void flush_tlb_kernel_range(unsigned long start,
7370
unsigned long end)
7471
{
7572
if (radix_enabled())
76-
return radix__flush_tlb_kernel_range(start, end);
77-
return hash__flush_tlb_kernel_range(start, end);
73+
radix__flush_tlb_kernel_range(start, end);
7874
}
7975

8076
static inline void local_flush_tlb_mm(struct mm_struct *mm)
8177
{
8278
if (radix_enabled())
83-
return radix__local_flush_tlb_mm(mm);
84-
return hash__local_flush_tlb_mm(mm);
79+
radix__local_flush_tlb_mm(mm);
8580
}
8681

8782
static inline void local_flush_tlb_page(struct vm_area_struct *vma,
8883
unsigned long vmaddr)
8984
{
9085
if (radix_enabled())
91-
return radix__local_flush_tlb_page(vma, vmaddr);
92-
return hash__local_flush_tlb_page(vma, vmaddr);
86+
radix__local_flush_tlb_page(vma, vmaddr);
9387
}
9488

9589
static inline void local_flush_all_mm(struct mm_struct *mm)
@@ -102,24 +96,21 @@ static inline void local_flush_all_mm(struct mm_struct *mm)
10296
static inline void tlb_flush(struct mmu_gather *tlb)
10397
{
10498
if (radix_enabled())
105-
return radix__tlb_flush(tlb);
106-
return hash__tlb_flush(tlb);
99+
radix__tlb_flush(tlb);
107100
}
108101

109102
#ifdef CONFIG_SMP
110103
static inline void flush_tlb_mm(struct mm_struct *mm)
111104
{
112105
if (radix_enabled())
113-
return radix__flush_tlb_mm(mm);
114-
return hash__flush_tlb_mm(mm);
106+
radix__flush_tlb_mm(mm);
115107
}
116108

117109
static inline void flush_tlb_page(struct vm_area_struct *vma,
118110
unsigned long vmaddr)
119111
{
120112
if (radix_enabled())
121-
return radix__flush_tlb_page(vma, vmaddr);
122-
return hash__flush_tlb_page(vma, vmaddr);
113+
radix__flush_tlb_page(vma, vmaddr);
123114
}
124115

125116
static inline void flush_all_mm(struct mm_struct *mm)

0 commit comments

Comments
 (0)