From patchwork Wed Jun 25 01:05:29 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guenter Roeck X-Patchwork-Id: 4415701 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 0F3C29F1D6 for ; Wed, 25 Jun 2014 01:08:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 245E72037A for ; Wed, 25 Jun 2014 01:08:50 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2CAB820034 for ; Wed, 25 Jun 2014 01:08:49 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Wzbfb-0007Pf-6l; Wed, 25 Jun 2014 01:06:39 +0000 Received: from mail-pb0-x235.google.com ([2607:f8b0:400e:c01::235]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Wzbf5-00076G-4e for linux-arm-kernel@lists.infradead.org; Wed, 25 Jun 2014 01:06:08 +0000 Received: by mail-pb0-f53.google.com with SMTP id uo5so951898pbc.40 for ; Tue, 24 Jun 2014 18:05:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id; bh=yXqfvCijzCfsmdb2JOknH6x+lC2svoGF8XWO88cEFxI=; b=xLb6zmz04XerBtB0+LR97PL2DilJIFl6j+ofJXjtk3iazFOF/J//pZY1QvO7fYPzpX sc0CZRrFKYcSunxRHiqwzDU/59pouMqGCUqCmTbPm3g6V9zoL0ifYevWpj9Z6bjsfXeZ gV6chuQJto8LziLKOMI60xwzRof/WuR5+8Cqk9NoxJ/hBUHQ3qssR7Umggk22neLOWxf mPoEYv4MqDREibjRoO2m4kwpZjr2WqqV7eVs/nV7YsrImeJFuHElhMSgZG66T4W4phPJ CDkNpiTTNaG8rmAA8Vw4HTKlCT4blA+vxuA+TM47q9yimW9pDuscx+Ua0kkR3L0MHKzZ SVDA== X-Received: by 10.68.189.232 with SMTP id gl8mr6386510pbc.89.1403658345475; Tue, 24 Jun 2014 18:05:45 -0700 (PDT) Received: from localhost (108-223-40-66.lightspeed.sntcca.sbcglobal.net. [108.223.40.66]) by mx.google.com with ESMTPSA id fd5sm9156956pad.12.2014.06.24.18.05.43 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 24 Jun 2014 18:05:44 -0700 (PDT) From: Guenter Roeck To: Ingo Molnar Subject: [PATCH v2] sched: Fix compiler warnings Date: Tue, 24 Jun 2014 18:05:29 -0700 Message-Id: <1403658329-13196-1-git-send-email-linux@roeck-us.net> X-Mailer: git-send-email 1.9.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140624_180607_199476_768BB71D X-CRM114-Status: GOOD ( 14.84 ) X-Spam-Score: -0.4 (/) Cc: Russell King , Peter Zijlstra , Benjamin Herrenschmidt , linux-kernel@vger.kernel.org, Ingo Molnar , Paul Mackerras , Guenter Roeck , Vincent Guittot , linuxppc-dev@lists.ozlabs.org, Dietmar Eggemann , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Commit 143e1e28cb (sched: Rework sched_domain topology definition) introduced a number of functions with a return value of 'const int'. gcc doesn't know what to do with that and, if the kernel is compiled with W=1, complains with the following warnings whenever sched.h is included. include/linux/sched.h:875:25: warning: type qualifiers ignored on function return type include/linux/sched.h:882:25: warning: type qualifiers ignored on function return type include/linux/sched.h:889:25: warning: type qualifiers ignored on function return type include/linux/sched.h:1002:21: warning: type qualifiers ignored on function return type Commits fb2aa855 (sched, ARM: Create a dedicated scheduler topology table) and 607b45e9a (sched, powerpc: Create a dedicated topology table) introduce the same warning in the arm and powerpc code. Drop 'const' from the function declarations to fix the problem. The fix for all three patches has to be applied together to avoid compilation failures for the affected architectures. Cc: Dietmar Eggemann Cc: Peter Zijlstra Cc: Ingo Molnar Cc: Benjamin Herrenschmidt Cc: Vincent Guittot Signed-off-by: Guenter Roeck Acked-by: Benjamin Herrenschmidt --- v2: Fix problem in all affected architectures with a single patch to avoid compilation errors. arch/arm/kernel/topology.c | 2 +- arch/powerpc/kernel/smp.c | 2 +- include/linux/sched.h | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/arch/arm/kernel/topology.c b/arch/arm/kernel/topology.c index 9d85318..e35d880 100644 --- a/arch/arm/kernel/topology.c +++ b/arch/arm/kernel/topology.c @@ -275,7 +275,7 @@ void store_cpu_topology(unsigned int cpuid) cpu_topology[cpuid].socket_id, mpidr); } -static inline const int cpu_corepower_flags(void) +static inline int cpu_corepower_flags(void) { return SD_SHARE_PKG_RESOURCES | SD_SHARE_POWERDOMAIN; } diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c index 51a3ff7..1007fb8 100644 --- a/arch/powerpc/kernel/smp.c +++ b/arch/powerpc/kernel/smp.c @@ -747,7 +747,7 @@ int setup_profiling_timer(unsigned int multiplier) #ifdef CONFIG_SCHED_SMT /* cpumask of CPUs with asymetric SMT dependancy */ -static const int powerpc_smt_flags(void) +static int powerpc_smt_flags(void) { int flags = SD_SHARE_CPUCAPACITY | SD_SHARE_PKG_RESOURCES; diff --git a/include/linux/sched.h b/include/linux/sched.h index 306f4f0..0376b05 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -872,21 +872,21 @@ enum cpu_idle_type { #define SD_NUMA 0x4000 /* cross-node balancing */ #ifdef CONFIG_SCHED_SMT -static inline const int cpu_smt_flags(void) +static inline int cpu_smt_flags(void) { return SD_SHARE_CPUCAPACITY | SD_SHARE_PKG_RESOURCES; } #endif #ifdef CONFIG_SCHED_MC -static inline const int cpu_core_flags(void) +static inline int cpu_core_flags(void) { return SD_SHARE_PKG_RESOURCES; } #endif #ifdef CONFIG_NUMA -static inline const int cpu_numa_flags(void) +static inline int cpu_numa_flags(void) { return SD_NUMA; } @@ -999,7 +999,7 @@ void free_sched_domains(cpumask_var_t doms[], unsigned int ndoms); bool cpus_share_cache(int this_cpu, int that_cpu); typedef const struct cpumask *(*sched_domain_mask_f)(int cpu); -typedef const int (*sched_domain_flags_f)(void); +typedef int (*sched_domain_flags_f)(void); #define SDTL_OVERLAP 0x01