cpuset: remove function attribute const
PATCH 1/1 cpuset: remove function attribute const
gcc-4 warns withinclude/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]>
kernel/cpuset.c renamed from kernel/cpuset.c.orig +1 -1
@@ -1432,7 +1432,7 @@ void cpuset_exit(struct task_struct *tsk* 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;
include/linux/cpuset.h renamed from include/linux/cpuset.h.orig +1 -1
@@ -18,7 +18,7 @@ extern int cpuset_init(void);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);
Quoted 1 line · Benoit
The following patch remove const from the function declaration.
Acked-by Paul Jackson <[email protected]>
Signature · 3 lines
I won't rest till it's the best ...
Programmer, Linux Scalability
Paul Jackson <[email protected]> 1.650.933.1373, 1.925.600.0401