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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Fri, 5 Oct 2012 16:49:55 -0300
From:	Fabio Estevam <fabio.estevam@...escale.com>
To:	<peterz@...radead.org>
CC:	<mingo@...hat.com>, <linux-kernel@...r.kernel.org>,
	<arnd@...db.de>, <festevam@...il.com>,
	Fabio Estevam <fabio.estevam@...escale.com>
Subject: [PATCH 2/2] sched: fair: Fix "declared 'static' but never defined" warning

commit 4ae834f767 (sched/numa: Implement NUMA home-node selection code)
caused the following warning on a !CONFIG_SMP system:

kernel/sched/fair.c:801:22: warning: 'task_h_load' declared 'static' but never defined [-Wunused-function]

Instead of doing the forward declaration of task_h_load(), declare it sooner to avoid
the warning in the !CONFIG_SMP case.

Signed-off-by: Fabio Estevam <fabio.estevam@...escale.com>
---
 kernel/sched/fair.c |   36 +++++++++++++++++++-----------------
 1 file changed, 19 insertions(+), 17 deletions(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index b75a336..d57b5fd 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -798,7 +798,25 @@ update_stats_curr_start(struct cfs_rq *cfs_rq, struct sched_entity *se)
  * information we have.
  */
 
-static unsigned long task_h_load(struct task_struct *p);
+#ifdef CONFIG_SMP
+#ifdef CONFIG_FAIR_GROUP_SCHED
+static unsigned long task_h_load(struct task_struct *p)
+{
+	struct cfs_rq *cfs_rq = task_cfs_rq(p);
+	unsigned long load;
+
+	load = p->se.load.weight;
+	load = div_u64(load * cfs_rq->h_load, cfs_rq->load.weight + 1);
+
+	return load;
+}
+#else
+static unsigned long task_h_load(struct task_struct *p)
+{
+	return p->se.load.weight;
+}
+#endif /* CONFIG_FAIR_GROUP_SCHED */
+#endif /* CONFIG_SMP */
 
 #ifdef CONFIG_SCHED_NUMA
 #ifdef CONFIG_SMP
@@ -3757,17 +3775,6 @@ static void update_h_load(long cpu)
 	walk_tg_tree(tg_load_down, tg_nop, (void *)cpu);
 	rcu_read_unlock();
 }
-
-static unsigned long task_h_load(struct task_struct *p)
-{
-	struct cfs_rq *cfs_rq = task_cfs_rq(p);
-	unsigned long load;
-
-	load = p->se.load.weight;
-	load = div_u64(load * cfs_rq->h_load, cfs_rq->load.weight + 1);
-
-	return load;
-}
 #else
 static inline void update_shares(int cpu)
 {
@@ -3776,11 +3783,6 @@ static inline void update_shares(int cpu)
 static inline void update_h_load(long cpu)
 {
 }
-
-static unsigned long task_h_load(struct task_struct *p)
-{
-	return p->se.load.weight;
-}
 #endif
 
 /********** Helpers for find_busiest_group ************************/
-- 
1.7.9.5


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ