Linux-RISC-V Archive mirror
 help / color / mirror / Atom feed
From: Charlie Jenkins <charlie@rivosinc.com>
To: Paul Walmsley <paul.walmsley@sifive.com>,
	 Palmer Dabbelt <palmer@dabbelt.com>,
	Albert Ou <aou@eecs.berkeley.edu>,
	 Atish Patra <atishp@rivosinc.com>,
	 Samuel Holland <samuel.holland@sifive.com>,
	 Alexandre Ghiti <alexghiti@rivosinc.com>
Cc: Palmer Dabbelt <palmer@rivosinc.com>,
	linux-riscv@lists.infradead.org,  linux-kernel@vger.kernel.org,
	Charlie Jenkins <charlie@rivosinc.com>,
	 kernel test robot <lkp@intel.com>
Subject: [PATCH riscv/for-next] riscv: cacheflush: Fix warning when compiled without CONFIG_SMP
Date: Wed, 17 Apr 2024 16:49:48 -0700	[thread overview]
Message-ID: <20240417-fix_nosmp_icache-v1-1-921a3c07d4ce@rivosinc.com> (raw)

GCC tries to compile the static function set_icache_stale_mask() even
when there are no callers. Guard the function with #ifdef CONFIG_SMP.

Signed-off-by: Charlie Jenkins <charlie@rivosinc.com>
Fixes: 383289e4b071 ("riscv: Include riscv_set_icache_flush_ctx prctl")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202404180621.qG7A9Tk0-lkp@intel.com/
---
Since this is just in for-next Palmer do you want to squash this onto the
commit that introduced this 383289e4b071?
---
 arch/riscv/mm/cacheflush.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/riscv/mm/cacheflush.c b/arch/riscv/mm/cacheflush.c
index 3b03534e57b4..3ef666c7dfc7 100644
--- a/arch/riscv/mm/cacheflush.c
+++ b/arch/riscv/mm/cacheflush.c
@@ -154,6 +154,7 @@ void __init riscv_init_cbo_blocksizes(void)
 		riscv_cboz_block_size = cboz_block_size;
 }
 
+#ifdef CONFIG_SMP
 static void set_icache_stale_mask(void)
 {
 	cpumask_t *mask;
@@ -171,6 +172,7 @@ static void set_icache_stale_mask(void)
 	cpumask_setall(mask);
 	cpumask_assign_cpu(smp_processor_id(), mask, stale_cpu);
 }
+#endif
 
 /**
  * riscv_set_icache_flush_ctx() - Enable/disable icache flushing instructions in

---
base-commit: a76716f0ec75b9e7ac62d30854d690044c857684
change-id: 20240417-fix_nosmp_icache-0fc36aeafbe5
-- 
- Charlie


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

             reply	other threads:[~2024-04-17 23:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-17 23:49 Charlie Jenkins [this message]
2024-04-24 11:48 ` [PATCH riscv/for-next] riscv: cacheflush: Fix warning when compiled without CONFIG_SMP Conor Dooley

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=20240417-fix_nosmp_icache-v1-1-921a3c07d4ce@rivosinc.com \
    --to=charlie@rivosinc.com \
    --cc=alexghiti@rivosinc.com \
    --cc=aou@eecs.berkeley.edu \
    --cc=atishp@rivosinc.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=lkp@intel.com \
    --cc=palmer@dabbelt.com \
    --cc=palmer@rivosinc.com \
    --cc=paul.walmsley@sifive.com \
    --cc=samuel.holland@sifive.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).