Skip to content

Commit

Permalink
cpumask: remove dangerous CPU_MASK_ALL_PTR
Browse files Browse the repository at this point in the history
(Thanks to Al Viro for reminding me of this, via Ingo)

CPU_MASK_ALL is the (deprecated) "all bits set" cpumask, defined as so:

	#define CPU_MASK_ALL (cpumask_t) { { ... } }

Taking the address of such a temporary is questionable at best,
unfortunately 321a8e9 (cpumask: add CPU_MASK_ALL_PTR macro) added
CPU_MASK_ALL_PTR:

	#define CPU_MASK_ALL_PTR (&CPU_MASK_ALL)

Which formalizes this practice.  One day gcc could bite us over this
usage (though we seem to have gotten away with it so far).

Now all callers are removed, we kill it.

Signed-off-by: Rusty Russell <[email protected]>
Acked-by: Ingo Molnar <[email protected]>
Reported-by: Al Viro <[email protected]>
Cc: Mike Travis <[email protected]>
  • Loading branch information
rustyrussell committed Sep 24, 2009
1 parent 29c337a commit a0219d9
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions include/linux/cpumask.h
Original file line number Diff line number Diff line change
Expand Up @@ -324,8 +324,6 @@ static inline const struct cpumask *get_cpu_mask(unsigned int cpu)
[BITS_TO_LONGS(NR_CPUS)-1] = CPU_MASK_LAST_WORD \
} }

#define CPU_MASK_ALL_PTR (&CPU_MASK_ALL)

#else

#define CPU_MASK_ALL \
Expand All @@ -336,7 +334,6 @@ static inline const struct cpumask *get_cpu_mask(unsigned int cpu)

/* cpu_mask_all is in init/main.c */
extern cpumask_t cpu_mask_all;
#define CPU_MASK_ALL_PTR (&cpu_mask_all)

#endif

Expand Down

0 comments on commit a0219d9

Please sign in to comment.