aboutsummaryrefslogtreecommitdiff
path: root/source/cpu_id.cc
diff options
context:
space:
mode:
authorFrank Barchard <fbarchard@google.com>2017-03-01 12:07:36 -0800
committerCommit Bot <commit-bot@chromium.org>2017-03-01 23:07:03 +0000
commit91ee9b729ee4e2366ded623262bf74adcfdbb413 (patch)
tree032d73421e376582a5556094a1e90602970dd16f /source/cpu_id.cc
parentfb45d18db5925d75c81c3cb0f53758bad582009e (diff)
downloadlibyuv-91ee9b729ee4e2366ded623262bf74adcfdbb413.tar.gz
Fix missing return in MipsCpuCaps.
Previously if MipsCpuCaps were called with something other than dspr2 or msa, the file was closed but still used. This change assumed the function is only called internally twice: once for msa and once for dspr2. If msa is not being detected, the function assumed dspr2 was being tested and returns dspr2 was true. BUG=libyuv:687 TEST=try bots Change-Id: I80b328eb5ffc7baf5f1ee5a79c16d75c45ff26cc Reviewed-on: https://chromium-review.googlesource.com/447831 Reviewed-by: Frank Barchard <fbarchard@google.com> Commit-Queue: Frank Barchard <fbarchard@google.com>
Diffstat (limited to 'source/cpu_id.cc')
-rw-r--r--source/cpu_id.cc8
1 files changed, 2 insertions, 6 deletions
diff --git a/source/cpu_id.cc b/source/cpu_id.cc
index 9ff93263..afb5d282 100644
--- a/source/cpu_id.cc
+++ b/source/cpu_id.cc
@@ -174,9 +174,7 @@ LIBYUV_API SAFEBUFFERS int MipsCpuCaps(const char* cpuinfo_name,
if (strcmp(ase, " msa") == 0) {
return kCpuHasMSA;
}
- if (strcmp(ase, " dspr2") == 0) {
- return kCpuHasDSPR2;
- }
+ return kCpuHasDSPR2;
}
while (fgets(cpuinfo_line, sizeof(cpuinfo_line) - 1, f)) {
if (memcmp(cpuinfo_line, "ASEs implemented", 16) == 0) {
@@ -186,9 +184,7 @@ LIBYUV_API SAFEBUFFERS int MipsCpuCaps(const char* cpuinfo_name,
if (strcmp(ase, " msa") == 0) {
return kCpuHasMSA;
}
- if (strcmp(ase, " dspr2") == 0) {
- return kCpuHasDSPR2;
- }
+ return kCpuHasDSPR2;
}
}
}