From bbc770079e269bd28d676bc2c2faa74ba3fa8fd6 Mon Sep 17 00:00:00 2001 From: nihui Date: Wed, 22 Feb 2023 19:04:41 +0800 Subject: [PATCH] silence fopen error on sysfs cache files --- src/cpu.cpp | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/cpu.cpp b/src/cpu.cpp index 62ad7d0b737..8d6b50f5209 100644 --- a/src/cpu.cpp +++ b/src/cpu.cpp @@ -1414,10 +1414,7 @@ static int get_data_cache_size(int cpuid, int level) sprintf(path, "/sys/devices/system/cpu/cpu%d/cache/index%d/size", cpuid, indexid); FILE* fp = fopen(path, "rb"); if (!fp) - { - NCNN_LOGE("fopen %s failed", path); return 0; - } int nscan = fscanf(fp, "%dK", &cache_size_K); if (nscan != 1) @@ -1434,10 +1431,7 @@ static int get_data_cache_size(int cpuid, int level) sprintf(path, "/sys/devices/system/cpu/cpu%d/cache/index%d/shared_cpu_map", cpuid, indexid); FILE* fp = fopen(path, "rb"); if (!fp) - { - NCNN_LOGE("fopen %s failed", path); return 0; - } char shared_cpu_map_str[256]; int nscan = fscanf(fp, "%255s", shared_cpu_map_str);