From: Ted Chen <znscnchen@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: dave.hansen@linux.intel.com, luto@kernel.org,
peterz@infradead.org, Ted Chen <znscnchen@gmail.com>
Subject: [PATCH] x86/ioremap: Combine prot calulation in __ioremap_caller()
Date: Mon, 27 Nov 2023 20:48:48 +0800 [thread overview]
Message-ID: <20231127124848.90361-1-znscnchen@gmail.com> (raw)
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
reply other threads:[~2023-11-27 12:49 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20231127124848.90361-1-znscnchen@gmail.com \
--to=znscnchen@gmail.com \
--cc=dave.hansen@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@kernel.org \
--cc=peterz@infradead.org \
/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 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®