Skip to content

Commit

Permalink
[PATCH] cpuset: remove function attribute const
Browse files Browse the repository at this point in the history
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 <benoit.boissinot@ens-lyon.org>
Acked-by: Paul Jackson <pj@sgi.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Benoit Boissinot authored and Linus Torvalds committed Apr 16, 2005
1 parent b52402c commit 9a84889
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion include/linux/cpuset.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion kernel/cpuset.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 9a84889

Please sign in to comment.