aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSiva Chandra Reddy <sivachandra@google.com>2022-03-15 21:34:51 +0000
committerSiva Chandra Reddy <sivachandra@google.com>2022-03-15 21:51:12 +0000
commite9c9ee9fe694067ee96643d05d6ac378349386bb (patch)
tree506b6d5c6198d7471efeda5dabf6ee47c847bb7e
parent7ecb7efc898981c980a1ce50f0ef32b337e66bb9 (diff)
downloadllvm-e9c9ee9fe694067ee96643d05d6ac378349386bb.zip
llvm-e9c9ee9fe694067ee96643d05d6ac378349386bb.tar.gz
llvm-e9c9ee9fe694067ee96643d05d6ac378349386bb.tar.bz2
[libc][NFC] Fix typos and reduntent code triggering compiler warinings.
-rw-r--r--libc/src/__support/threads/linux/mutex.h4
-rw-r--r--libc/src/threads/mtx_init.cpp2
2 files changed, 1 insertions, 5 deletions
diff --git a/libc/src/__support/threads/linux/mutex.h b/libc/src/__support/threads/linux/mutex.h
index feb5c0f..9b2bfa2 100644
--- a/libc/src/__support/threads/linux/mutex.h
+++ b/libc/src/__support/threads/linux/mutex.h
@@ -96,10 +96,6 @@ public:
continue;
case LockState::Free:
// If it was LockState::Free, we shouldn't be here at all.
- [[clang::fallthrough]];
- default:
- // Mutex status cannot be anything else. So control should not reach
- // here at all.
return MutexError::BAD_LOCK_STATE;
}
}
diff --git a/libc/src/threads/mtx_init.cpp b/libc/src/threads/mtx_init.cpp
index 367e91d..f3d1ee6 100644
--- a/libc/src/threads/mtx_init.cpp
+++ b/libc/src/threads/mtx_init.cpp
@@ -14,7 +14,7 @@
namespace __llvm_libc {
LLVM_LIBC_FUNCTION(int, mtx_init, (mtx_t * m, int type)) {
- auto err = Mutex::init(m, type | mtx_timed, type | mtx_recursive, 0);
+ auto err = Mutex::init(m, type & mtx_timed, type & mtx_recursive, 0);
return err == MutexError::NONE ? thrd_success : thrd_error;
}