hc
2023-11-06 e3e12f52b214121840b44c91de5b3e5af5d3eb84
kernel/drivers/infiniband/hw/qib/qib_file_ops.c
....@@ -1142,7 +1142,7 @@
11421142 static void assign_ctxt_affinity(struct file *fp, struct qib_devdata *dd)
11431143 {
11441144 struct qib_filedata *fd = fp->private_data;
1145
- const unsigned int weight = cpumask_weight(&current->cpus_allowed);
1145
+ const unsigned int weight = current->nr_cpus_allowed;
11461146 const struct cpumask *local_mask = cpumask_of_pcibus(dd->pcidev->bus);
11471147 int local_cpu;
11481148
....@@ -1623,9 +1623,8 @@
16231623 ret = find_free_ctxt(i_minor - 1, fp, uinfo);
16241624 else {
16251625 int unit;
1626
- const unsigned int cpu = cpumask_first(&current->cpus_allowed);
1627
- const unsigned int weight =
1628
- cpumask_weight(&current->cpus_allowed);
1626
+ const unsigned int cpu = cpumask_first(current->cpus_ptr);
1627
+ const unsigned int weight = current->nr_cpus_allowed;
16291628
16301629 if (weight == 1 && !test_bit(cpu, qib_cpulist))
16311630 if (!find_hca(cpu, &unit) && unit >= 0)