All of lore.kernel.org
 help / color / mirror / Atom feed
From: Benjamin Gray <bgray@linux.ibm.com>
To: linuxppc-dev@lists.ozlabs.org
Cc: ajd@linux.ibm.com, jniethe5@gmail.com,
	Benjamin Gray <bgray@linux.ibm.com>,
	npiggin@gmail.com, cmr@bluescreens.de
Subject: [PATCH v10 4/9] powerpc/mm: Remove empty hash__ functions
Date: Wed,  9 Nov 2022 15:51:07 +1100	[thread overview]
Message-ID: <20221109045112.187069-5-bgray@linux.ibm.com> (raw)
In-Reply-To: <20221109045112.187069-1-bgray@linux.ibm.com>

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 <bgray@linux.ibm.com>
---
v10:	* New in v10 for consistency with new functions
---
 .../include/asm/book3s/64/tlbflush-hash.h     | 28 -------------------
 arch/powerpc/include/asm/book3s/64/tlbflush.h | 27 ++++++------------
 2 files changed, 9 insertions(+), 46 deletions(-)

diff --git a/arch/powerpc/include/asm/book3s/64/tlbflush-hash.h b/arch/powerpc/include/asm/book3s/64/tlbflush-hash.h
index 3c89e625e620..38d31c2489d3 100644
--- a/arch/powerpc/include/asm/book3s/64/tlbflush-hash.h
+++ b/arch/powerpc/include/asm/book3s/64/tlbflush-hash.h
@@ -58,13 +58,6 @@ void flush_hash_page(unsigned long vpn, real_pte_t pte, int psize, int ssize,
 void flush_hash_range(unsigned long number, int local);
 void flush_hash_hugepage(unsigned long vsid, unsigned long addr, pmd_t *pmdp,
 			 unsigned int psize, int ssize, unsigned long flags);
-static inline void hash__local_flush_tlb_mm(struct mm_struct *mm)
-{
-}
-
-static inline void hash__flush_tlb_mm(struct mm_struct *mm)
-{
-}
 
 static inline void hash__local_flush_all_mm(struct mm_struct *mm)
 {
@@ -88,27 +81,6 @@ static inline void hash__flush_all_mm(struct mm_struct *mm)
 	WARN_ON_ONCE(1);
 }
 
-static inline void hash__local_flush_tlb_page(struct vm_area_struct *vma,
-					  unsigned long vmaddr)
-{
-}
-
-static inline void hash__flush_tlb_page(struct vm_area_struct *vma,
-				    unsigned long vmaddr)
-{
-}
-
-static inline void hash__flush_tlb_range(struct vm_area_struct *vma,
-				     unsigned long start, unsigned long end)
-{
-}
-
-static inline void hash__flush_tlb_kernel_range(unsigned long start,
-					    unsigned long end)
-{
-}
-
-
 struct mmu_gather;
 void hash__tlb_flush(struct mmu_gather *tlb);
 
diff --git a/arch/powerpc/include/asm/book3s/64/tlbflush.h b/arch/powerpc/include/asm/book3s/64/tlbflush.h
index 67655cd60545..2254a40f0564 100644
--- a/arch/powerpc/include/asm/book3s/64/tlbflush.h
+++ b/arch/powerpc/include/asm/book3s/64/tlbflush.h
@@ -47,8 +47,7 @@ static inline void flush_pmd_tlb_range(struct vm_area_struct *vma,
 				       unsigned long start, unsigned long end)
 {
 	if (radix_enabled())
-		return radix__flush_pmd_tlb_range(vma, start, end);
-	return hash__flush_tlb_range(vma, start, end);
+		radix__flush_pmd_tlb_range(vma, start, end);
 }
 
 #define __HAVE_ARCH_FLUSH_HUGETLB_TLB_RANGE
@@ -57,39 +56,34 @@ static inline void flush_hugetlb_tlb_range(struct vm_area_struct *vma,
 					   unsigned long end)
 {
 	if (radix_enabled())
-		return radix__flush_hugetlb_tlb_range(vma, start, end);
-	return hash__flush_tlb_range(vma, start, end);
+		radix__flush_hugetlb_tlb_range(vma, start, end);
 }
 
 static inline void flush_tlb_range(struct vm_area_struct *vma,
 				   unsigned long start, unsigned long end)
 {
 	if (radix_enabled())
-		return radix__flush_tlb_range(vma, start, end);
-	return hash__flush_tlb_range(vma, start, end);
+		radix__flush_tlb_range(vma, start, end);
 }
 
 static inline void flush_tlb_kernel_range(unsigned long start,
 					  unsigned long end)
 {
 	if (radix_enabled())
-		return radix__flush_tlb_kernel_range(start, end);
-	return hash__flush_tlb_kernel_range(start, end);
+		radix__flush_tlb_kernel_range(start, end);
 }
 
 static inline void local_flush_tlb_mm(struct mm_struct *mm)
 {
 	if (radix_enabled())
-		return radix__local_flush_tlb_mm(mm);
-	return hash__local_flush_tlb_mm(mm);
+		radix__local_flush_tlb_mm(mm);
 }
 
 static inline void local_flush_tlb_page(struct vm_area_struct *vma,
 					unsigned long vmaddr)
 {
 	if (radix_enabled())
-		return radix__local_flush_tlb_page(vma, vmaddr);
-	return hash__local_flush_tlb_page(vma, vmaddr);
+		radix__local_flush_tlb_page(vma, vmaddr);
 }
 
 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)
 static inline void tlb_flush(struct mmu_gather *tlb)
 {
 	if (radix_enabled())
-		return radix__tlb_flush(tlb);
-	return hash__tlb_flush(tlb);
+		radix__tlb_flush(tlb);
 }
 
 #ifdef CONFIG_SMP
 static inline void flush_tlb_mm(struct mm_struct *mm)
 {
 	if (radix_enabled())
-		return radix__flush_tlb_mm(mm);
-	return hash__flush_tlb_mm(mm);
+		radix__flush_tlb_mm(mm);
 }
 
 static inline void flush_tlb_page(struct vm_area_struct *vma,
 				  unsigned long vmaddr)
 {
 	if (radix_enabled())
-		return radix__flush_tlb_page(vma, vmaddr);
-	return hash__flush_tlb_page(vma, vmaddr);
+		radix__flush_tlb_page(vma, vmaddr);
 }
 
 static inline void flush_all_mm(struct mm_struct *mm)
-- 
2.38.1


  parent reply	other threads:[~2022-11-09  4:54 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-09  4:51 [PATCH v10 0/9] powerpc/code-patching: Use temporary mm for Radix MMU Benjamin Gray
2022-11-09  4:51 ` [PATCH v10 1/9] powerpc: Allow clearing and restoring registers independent of saved breakpoint state Benjamin Gray
2022-11-09  4:51 ` [PATCH v10 2/9] powerpc/code-patching: Use WARN_ON and fix check in poking_init Benjamin Gray
2022-11-09  6:12   ` Christophe Leroy
2022-11-09  4:51 ` [PATCH v10 3/9] powerpc/mm: Remove extern from function prototypes Benjamin Gray
2022-11-09  6:16   ` Christophe Leroy
2022-11-25  3:12   ` Andrew Donnellan
2022-11-09  4:51 ` Benjamin Gray [this message]
2022-11-09  6:16   ` [PATCH v10 4/9] powerpc/mm: Remove empty hash__ functions Christophe Leroy
2022-11-09  4:51 ` [PATCH v10 5/9] cxl: Use radix__flush_all_mm instead of generic flush_all_mm Benjamin Gray
2022-11-09  6:16   ` Christophe Leroy
2022-11-25  2:42   ` Andrew Donnellan
2022-11-09  4:51 ` [PATCH v10 6/9] powerpc/mm: Remove flush_all_mm, local_flush_all_mm Benjamin Gray
2022-11-09  6:17   ` Christophe Leroy
2022-11-09  4:51 ` [PATCH v10 7/9] powerpc/tlb: Add local flush for page given mm_struct and psize Benjamin Gray
2022-11-09  6:18   ` Christophe Leroy
2022-11-09  4:51 ` [PATCH v10 8/9] powerpc/code-patching: Use temporary mm for Radix MMU Benjamin Gray
2022-12-15 20:17   ` Nathan Chancellor
2022-12-15 20:17     ` Nathan Chancellor
2022-12-16  0:23     ` Michael Ellerman
2022-11-09  4:51 ` [PATCH v10 9/9] powerpc/code-patching: Consolidate and cache per-cpu patching context Benjamin Gray
2022-11-09  6:23   ` Christophe Leroy
2022-12-08 12:39 ` [PATCH v10 0/9] powerpc/code-patching: Use temporary mm for Radix MMU Michael Ellerman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221109045112.187069-5-bgray@linux.ibm.com \
    --to=bgray@linux.ibm.com \
    --cc=ajd@linux.ibm.com \
    --cc=cmr@bluescreens.de \
    --cc=jniethe5@gmail.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=npiggin@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.