From: Palmer Dabbelt <palmer@rivosinc.com>
To: panqinglin2020@iscas.ac.cn
Cc: Paul Walmsley <paul.walmsley@sifive.com>,
Palmer Dabbelt <palmer@dabbelt.com>,
aou@eecs.berkeley.edu, alexandre.ghiti@canonical.com,
jszhang@kernel.org, wangkefeng.wang@huawei.com,
mick@ics.forth.gr, vitaly.wool@konsulko.com, rppt@kernel.org,
linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org,
Palmer Dabbelt <palmer@rivosinc.com>,
kernel test robot <lkp@intel.com>
Subject: [PATCH v1] RISC-V: Add braces around an empty if statement bodies
Date: Tue, 19 Apr 2022 12:48:46 -0700 [thread overview]
Message-ID: <20220419194846.18318-1-palmer@rivosinc.com> (raw)
From: Palmer Dabbelt <palmer@rivosinc.com>
This triggers -Wempty-body, which will cause the next statement (eventually
create_pmd_mapping) to be dropped. Both of these were introduced by the same
commit. This is safe for the reporting config (which is 32-bit), but IIUC
could result in breakages for 64-bit configs without 4/5 level paging like the
XIP configs.
Reported-by: kernel test robot <lkp@intel.com>
Fixes: 677b9eb8810e ("riscv: mm: Prepare pt_ops helper functions for sv57")
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
---
Might be better to define these to functions that are empty, but that's
slightly different than just fixing the commit/warning in question.
---
arch/riscv/mm/init.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c
index 9535bea8688c..637916857c4d 100644
--- a/arch/riscv/mm/init.c
+++ b/arch/riscv/mm/init.c
@@ -798,13 +798,15 @@ static void __init create_fdt_early_page_table(pgd_t *pgdir, uintptr_t dtb_pa)
PGDIR_SIZE,
IS_ENABLED(CONFIG_64BIT) ? PAGE_TABLE : PAGE_KERNEL);
- if (pgtable_l5_enabled)
+ if (pgtable_l5_enabled) {
create_p4d_mapping(early_dtb_p4d, DTB_EARLY_BASE_VA,
(uintptr_t)early_dtb_pud, P4D_SIZE, PAGE_TABLE);
+ }
- if (pgtable_l4_enabled)
+ if (pgtable_l4_enabled) {
create_pud_mapping(early_dtb_pud, DTB_EARLY_BASE_VA,
(uintptr_t)early_dtb_pmd, PUD_SIZE, PAGE_TABLE);
+ }
if (IS_ENABLED(CONFIG_64BIT)) {
create_pmd_mapping(early_dtb_pmd, DTB_EARLY_BASE_VA,
--
2.34.1
next reply other threads:[~2022-04-19 20:17 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-19 19:48 Palmer Dabbelt [this message]
2022-04-19 20:38 ` Randy Dunlap
2022-04-20 18:49 ` Palmer Dabbelt
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=20220419194846.18318-1-palmer@rivosinc.com \
--to=palmer@rivosinc.com \
--cc=alexandre.ghiti@canonical.com \
--cc=aou@eecs.berkeley.edu \
--cc=jszhang@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=lkp@intel.com \
--cc=mick@ics.forth.gr \
--cc=palmer@dabbelt.com \
--cc=panqinglin2020@iscas.ac.cn \
--cc=paul.walmsley@sifive.com \
--cc=rppt@kernel.org \
--cc=vitaly.wool@konsulko.com \
--cc=wangkefeng.wang@huawei.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 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®