lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20231127124848.90361-1-znscnchen@gmail.com>
Date:   Mon, 27 Nov 2023 20:48:48 +0800
From:   Ted Chen <znscnchen@...il.com>
To:     linux-kernel@...r.kernel.org
Cc:     dave.hansen@...ux.intel.com, luto@...nel.org, peterz@...radead.org,
        Ted Chen <znscnchen@...il.com>
Subject: [PATCH] x86/ioremap: Combine prot calulation in __ioremap_caller()

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@...il.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ