mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] x86/ioremap: Combine prot calulation in __ioremap_caller()
@ 2023-11-27 12:48 Ted Chen
  0 siblings, 0 replies; only message in thread
From: Ted Chen @ 2023-11-27 12:48 UTC (permalink / raw)
  To: linux-kernel; +Cc: dave.hansen, luto, peterz, Ted Chen

Combine prot calculation in __ioremap_caller() to make code more readable.
There's no need to handle pcm for UC-, WC, WT separately.

No functional change expected.

Signed-off-by: Ted Chen <znscnchen@gmail.com>
---
 arch/x86/mm/ioremap.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/arch/x86/mm/ioremap.c b/arch/x86/mm/ioremap.c
index aa7d279321ea..6179921df3b1 100644
--- a/arch/x86/mm/ioremap.c
+++ b/arch/x86/mm/ioremap.c
@@ -271,16 +271,9 @@ __ioremap_caller(resource_size_t phys_addr, unsigned long size,
 				cachemode2protval(_PAGE_CACHE_MODE_UC));
 		break;
 	case _PAGE_CACHE_MODE_UC_MINUS:
-		prot = __pgprot(pgprot_val(prot) |
-				cachemode2protval(_PAGE_CACHE_MODE_UC_MINUS));
-		break;
 	case _PAGE_CACHE_MODE_WC:
-		prot = __pgprot(pgprot_val(prot) |
-				cachemode2protval(_PAGE_CACHE_MODE_WC));
-		break;
 	case _PAGE_CACHE_MODE_WT:
-		prot = __pgprot(pgprot_val(prot) |
-				cachemode2protval(_PAGE_CACHE_MODE_WT));
+		prot = __pgprot(pgprot_val(prot) | cachemode2protval(pcm));
 		break;
 	case _PAGE_CACHE_MODE_WB:
 		break;
-- 
2.25.1


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-11-27 12:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-27 12:48 [PATCH] x86/ioremap: Combine prot calulation in __ioremap_caller() Ted Chen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®