linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] smp: Fix unused-but-set-variable warning
@ 2020-07-06 13:49 Wei Yongjun
  0 siblings, 0 replies; only message in thread
From: Wei Yongjun @ 2020-07-06 13:49 UTC (permalink / raw)
  To: Hulk Robot, Peter Zijlstra, Ingo Molnar, Thomas Gleixner,
	Sebastian Andrzej Siewior, Paul E. McKenney, Peter Xu
  Cc: Wei Yongjun, linux-kernel

Gcc report build warning as follows:

kernel/smp.c:126:15: warning:
 variable 'csd_type' set but not used [-Wunused-but-set-variable]
  126 |  unsigned int csd_type;
      |               ^~~~~~~~

'csd_type' is only used when CONFIG_64BIT defined, so move them
under '#ifdef'.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 kernel/smp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/smp.c b/kernel/smp.c
index 6ec6c9578225..0130bdcf6d26 100644
--- a/kernel/smp.c
+++ b/kernel/smp.c
@@ -123,10 +123,10 @@ static void csd_lock_record(call_single_data_t *csd)
 
 static __always_inline int csd_lock_wait_getcpu(call_single_data_t *csd)
 {
+#ifdef CONFIG_64BIT
 	unsigned int csd_type;
 
 	csd_type = CSD_TYPE(csd);
-#ifdef CONFIG_64BIT
 	if (csd_type == CSD_TYPE_ASYNC || csd_type == CSD_TYPE_SYNC)
 		return csd->dst; // Other CSD_TYPE_ values might not have ->dst.
 #endif


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

only message in thread, other threads:[~2020-07-06 13:39 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-06 13:49 [PATCH -next] smp: Fix unused-but-set-variable warning Wei Yongjun

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 NNTP newsgroup(s).