hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/drivers/infiniband/hw/qib/qib_file_ops.c
....@@ -40,10 +40,10 @@
4040 #include <linux/highmem.h>
4141 #include <linux/io.h>
4242 #include <linux/jiffies.h>
43
-#include <asm/pgtable.h>
4443 #include <linux/delay.h>
4544 #include <linux/export.h>
4645 #include <linux/uio.h>
46
+#include <linux/pgtable.h>
4747
4848 #include <rdma/ib.h>
4949
....@@ -343,7 +343,7 @@
343343
344344 /* virtual address of first page in transfer */
345345 vaddr = ti->tidvaddr;
346
- if (!access_ok(VERIFY_WRITE, (void __user *) vaddr,
346
+ if (!access_ok((void __user *) vaddr,
347347 cnt * PAGE_SIZE)) {
348348 ret = -EFAULT;
349349 goto done;
....@@ -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)
....@@ -1790,7 +1789,6 @@
17901789
17911790 static int qib_close(struct inode *in, struct file *fp)
17921791 {
1793
- int ret = 0;
17941792 struct qib_filedata *fd;
17951793 struct qib_ctxtdata *rcd;
17961794 struct qib_devdata *dd;
....@@ -1874,7 +1872,7 @@
18741872
18751873 bail:
18761874 kfree(fd);
1877
- return ret;
1875
+ return 0;
18781876 }
18791877
18801878 static int qib_ctxt_info(struct file *fp, struct qib_ctxt_info __user *uinfo)