Skip to content

Commit

Permalink
silence fopen error on sysfs cache files
Browse files Browse the repository at this point in the history
  • Loading branch information
nihui authored Feb 22, 2023
1 parent 6f661f9 commit bbc7700
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions src/cpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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);
Expand Down

0 comments on commit bbc7700

Please sign in to comment.