OSDN Git Service

s390/cpumf: remove superfluous nr_cpumask_bits check
authorHeiko Carstens <heiko.carstens@de.ibm.com>
Thu, 21 Sep 2017 12:43:10 +0000 (14:43 +0200)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Thu, 28 Sep 2017 05:29:43 +0000 (07:29 +0200)
Paul Burton reported that the nr_cpumask_bits check
within cpumsf_pmu_event_init() is not necessary.

Actually there is already a prior check within
perf_event_alloc(). Therefore remove the check.

Reported-by: Paul Burton <paul.burton@imgtec.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
arch/s390/kernel/perf_cpum_sf.c

index 7e1e403..bd4bbf6 100644 (file)
@@ -823,12 +823,8 @@ static int cpumsf_pmu_event_init(struct perf_event *event)
        }
 
        /* Check online status of the CPU to which the event is pinned */
-       if (event->cpu >= 0) {
-               if ((unsigned int)event->cpu >= nr_cpumask_bits)
+       if (event->cpu >= 0 && !cpu_online(event->cpu))
                        return -ENODEV;
-               if (!cpu_online(event->cpu))
-                       return -ENODEV;
-       }
 
        /* Force reset of idle/hv excludes regardless of what the
         * user requested.