[IA64] Fix typo/thinko in arch/ia64/sn/kernel/sn2/sn2_smp.c
[firefly-linux-kernel-4.4.55.git] / arch / ia64 / sn / kernel / sn2 / sn2_smp.c
index 6dd886c5d860a29dd71b7c91a168728ff97b4611..1176506b2baeb780e5cad3ba08cb533c54a801d8 100644 (file)
@@ -133,7 +133,7 @@ sn2_ipi_flush_all_tlb(struct mm_struct *mm)
        unsigned long itc;
 
        itc = ia64_get_itc();
-       smp_flush_tlb_cpumask(mm->cpu_vm_mask);
+       smp_flush_tlb_cpumask(*mm_cpumask(mm));
        itc = ia64_get_itc() - itc;
        __get_cpu_var(ptcstats).shub_ipi_flushes_itc_clocks += itc;
        __get_cpu_var(ptcstats).shub_ipi_flushes++;
@@ -182,7 +182,7 @@ sn2_global_tlb_purge(struct mm_struct *mm, unsigned long start,
        nodes_clear(nodes_flushed);
        i = 0;
 
-       for_each_cpu_mask(cpu, mm->cpu_vm_mask) {
+       for_each_cpu(cpu, mm_cpumask(mm)) {
                cnode = cpu_to_node(cpu);
                node_set(cnode, nodes_flushed);
                lcpu = cpu;
@@ -461,7 +461,7 @@ bool sn_cpu_disable_allowed(int cpu)
 
 static void *sn2_ptc_seq_start(struct seq_file *file, loff_t * offset)
 {
-       if (*offset < NR_CPUS)
+       if (*offset < nr_cpu_ids)
                return offset;
        return NULL;
 }
@@ -469,7 +469,7 @@ static void *sn2_ptc_seq_start(struct seq_file *file, loff_t * offset)
 static void *sn2_ptc_seq_next(struct seq_file *file, void *data, loff_t * offset)
 {
        (*offset)++;
-       if (*offset < NR_CPUS)
+       if (*offset < nr_cpu_ids)
                return offset;
        return NULL;
 }
@@ -491,7 +491,7 @@ static int sn2_ptc_seq_show(struct seq_file *file, void *data)
                seq_printf(file, "# ptctest %d, flushopt %d\n", sn2_ptctest, sn2_flush_opt);
        }
 
-       if (cpu < NR_CPUS && cpu_online(cpu)) {
+       if (cpu < nr_cpu_ids && cpu_online(cpu)) {
                stat = &per_cpu(ptcstats, cpu);
                seq_printf(file, "cpu %d %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld\n", cpu, stat->ptc_l,
                                stat->change_rid, stat->shub_ptc_flushes, stat->nodes_flushed,
@@ -512,7 +512,7 @@ static ssize_t sn2_ptc_proc_write(struct file *file, const char __user *user, si
        int cpu;
        char optstr[64];
 
-       if (count > sizeof(optstr))
+       if (count == 0 || count > sizeof(optstr))
                return -EINVAL;
        if (copy_from_user(optstr, user, count))
                return -EFAULT;
@@ -554,7 +554,7 @@ static int __init sn2_ptc_init(void)
 
        proc_sn2_ptc = proc_create(PTC_BASENAME, 0444,
                                   NULL, &proc_sn2_ptc_operations);
-       if (!&proc_sn2_ptc_operations) {
+       if (!proc_sn2_ptc) {
                printk(KERN_ERR "unable to create %s proc entry", PTC_BASENAME);
                return -EINVAL;
        }