]> git.infradead.org Git - users/mchehab/rasdaemon.git/commitdiff
ras-events: drop a dead code to check number of CPUs
authorMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Thu, 18 Jul 2024 12:23:43 +0000 (14:23 +0200)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Thu, 18 Jul 2024 12:24:22 +0000 (14:24 +0200)
Just use sysconf(_SC_NPROCESSORS_ONLN) here.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
ras-events.c

index 29056446fa053d57e4737288f1444083e410fb90..53e15dedf36deeb26d4b852122cf78ee019dc0e7 100644 (file)
@@ -387,26 +387,6 @@ static void parse_ras_data(struct pthread_data *pdata, struct kbuffer *kbuf,
 static int get_num_cpus(struct ras_events *ras)
 {
        return sysconf(_SC_NPROCESSORS_ONLN);
-#if 0
-       char fname[MAX_PATH + 1];
-       int num_cpus = 0;
-       DIR             *dir;
-       struct dirent   *entry;
-
-       strcpy(fname, ras->debugfs);
-       strcat(fname, "/tracing/per_cpu/");
-       dir = opendir(fname);
-       if (!dir)
-               return -1;
-
-       for (entry = readdir(dir); entry; entry = readdir(dir)) {
-               if (strstr(entry->d_name, "cpu"))
-                       num_cpus++;
-       }
-       closedir(dir);
-
-       return num_cpus;
-#endif
 }
 
 static int set_buffer_percent(struct ras_events *ras, int percent)