Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a899b908 authored by Joel Fernandes's avatar Joel Fernandes
Browse files

sched/core: fix have_sched_energy_data build warning

have_sched_energy_data is defined only for CONFIG_SMP, so declare it
only with CONFIG_SMP.

Fixes warning from intel bot:

tree:   https://android.googlesource.com/kernel/msm

 android-4.4
head:   a2129978
commit: a2129978 [5/5] sched/core: Warn
if ENERGY_AWARE is enabled but data is missing
config: i386-randconfig-x002-201743 (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
        git checkout a2129978
        # save the attached .config to linux build tree
        make ARCH=i386

All warnings (new ones prefixed by >>):

>> kernel//sched/core.c:94:13: warning: 'have_sched_energy_data' used
but never defined
    static bool have_sched_energy_data(void);
                ^~~~~~~~~~~~~~~~~~~~~~

vim +/have_sched_energy_data +94 kernel//sched/core.c

    93
  > 94  static bool have_sched_energy_data(void);
    95

Change-Id: I266b63ece6fb31d2b5b11821a8244e147ba6d3a4
Signed-off-by: default avatarJoel Fernandes <joelaf@google.com>
parent a2129978
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -91,7 +91,9 @@
#include <trace/events/sched.h>
#include "walt.h"

#ifdef CONFIG_SMP
static bool have_sched_energy_data(void);
#endif

DEFINE_MUTEX(sched_domains_mutex);
DEFINE_PER_CPU_SHARED_ALIGNED(struct rq, runqueues);
@@ -195,10 +197,11 @@ static int sched_feat_set(char *cmp)
				sysctl_sched_features &= ~(1UL << i);
				sched_feat_disable(i);
			} else {
#ifdef CONFIG_SMP
				if (i == __SCHED_FEAT_ENERGY_AWARE)
					WARN(!have_sched_energy_data(),
					     "Missing sched energy data\n");

#endif
				sysctl_sched_features |= (1UL << i);
				sched_feat_enable(i);
			}