mirror of
https://github.com/SCST-project/scst.git
synced 2026-08-01 12:56:13 +00:00
scst: Switch from the cpu_*() to the cpumask_*() API
The cpus_*() functions were deprecated via patch "cpumask: introduce new API, without changing anything" (November 2008, commit ID 2d3854a37e8b). Hence switch from the cpus_*() API to the cpumask_*() API. This patch has the intended side effect of not adding the "[key]" property to cpumask sysfs attributes that contain the default cpumask. The current code namely reads uninitialized bits on systems where nr_cpu_ids < NR_CPUS because cpus_equal() compares more bits than those that were set by cpumask_copy(). Signed-off-by: Bart Van Assche <bvanassche@acm.org> git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5596 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -173,6 +173,27 @@ static inline void cpumask_copy(cpumask_t *dstp,
|
||||
{
|
||||
bitmap_copy(cpumask_bits(dstp), cpumask_bits(srcp), nr_cpumask_bits);
|
||||
}
|
||||
|
||||
/**
|
||||
* cpumask_setall - set all cpus (< nr_cpu_ids) in a cpumask
|
||||
* @dstp: the cpumask pointer
|
||||
*/
|
||||
static inline void cpumask_setall(cpumask_t *dstp)
|
||||
{
|
||||
bitmap_fill(cpumask_bits(dstp), nr_cpumask_bits);
|
||||
}
|
||||
|
||||
/**
|
||||
* cpumask_equal - *src1p == *src2p
|
||||
* @src1p: the first input
|
||||
* @src2p: the second input
|
||||
*/
|
||||
static inline bool cpumask_equal(const cpumask_t *src1p,
|
||||
const cpumask_t *src2p)
|
||||
{
|
||||
return bitmap_equal(cpumask_bits(src1p), cpumask_bits(src2p),
|
||||
nr_cpumask_bits);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 26) && \
|
||||
|
||||
Reference in New Issue
Block a user