tree ca559b5894089e93ed0666bbe883b218f4b82135
parent 87fdd2da7a7e707934ab4b375c8e62fad6d58e01
author Benoit Boissinot <[EMAIL PROTECTED]> Tue Apr 12 08:26:27 2005
committer Linus Torvalds <[EMAIL PROTECTED]> Tue Apr 12 08:26:27 2005

[PATCH] cpuset: remove function attribute const

gcc-4 warns with
include/linux/cpuset.h:21: warning: type qualifiers ignored on function
return type

cpuset_cpus_allowed is declared with const
extern const cpumask_t cpuset_cpus_allowed(const struct task_struct *p);

First const should be __attribute__((const)), but the gcc manual
explains that:

"Note that a function that has pointer arguments and examines the data
pointed to must not be declared const. Likewise, a function that calls a
non-const function usually must not be const. It does not make sense for
a const function to return void."

The following patch remove const from the function declaration.

Signed-off-by: Benoit Boissinot <[EMAIL PROTECTED]>
Acked-by: Paul Jackson <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>

 include/linux/cpuset.h |    2 +-
 kernel/cpuset.c        |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Index: include/linux/cpuset.h
===================================================================
--- 8b39eca8c4a63a231a6c523d309bc1ae3fa4e1bd/include/linux/cpuset.h  
(mode:100644 sha1:d3828ab266240a817e230fa8d315f482af613611)
+++ ca559b5894089e93ed0666bbe883b218f4b82135/include/linux/cpuset.h  
(mode:100644 sha1:be81dc154fa3a6d81436a1a9f2ae9d8fb2aab1f6)
@@ -18,7 +18,7 @@
 extern void cpuset_init_smp(void);
 extern void cpuset_fork(struct task_struct *p);
 extern void cpuset_exit(struct task_struct *p);
-extern const cpumask_t cpuset_cpus_allowed(const struct task_struct *p);
+extern cpumask_t cpuset_cpus_allowed(const struct task_struct *p);
 void cpuset_init_current_mems_allowed(void);
 void cpuset_update_current_mems_allowed(void);
 void cpuset_restrict_to_mems_allowed(unsigned long *nodes);
Index: kernel/cpuset.c
===================================================================
--- 8b39eca8c4a63a231a6c523d309bc1ae3fa4e1bd/kernel/cpuset.c  (mode:100644 
sha1:f92fddb449c125a861e8d1ba80fe29dff30bee43)
+++ ca559b5894089e93ed0666bbe883b218f4b82135/kernel/cpuset.c  (mode:100644 
sha1:d1d91cea5c9a816ece47f0315a28a069b4d3d367)
@@ -1432,7 +1432,7 @@
  * tasks cpuset.
  **/
 
-const cpumask_t cpuset_cpus_allowed(const struct task_struct *tsk)
+cpumask_t cpuset_cpus_allowed(const struct task_struct *tsk)
 {
        cpumask_t mask;
 
-
To unsubscribe from this list: send the line "unsubscribe bk-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to