From 141cceee587d5a8867f9a19045ad22bb4369d955 Mon Sep 17 00:00:00 2001 From: Yi Kong Date: Thu, 1 Mar 2018 17:48:53 -0500 Subject: [PATCH] Remove unreachable condition Comparison of unsigned enum expression < 0 is always false. Fixes tautological-unsigned-enum-zero-compare warning. Bug: 72331526 Test: m Change-Id: I17eb218b256015f5f406fd24324a49b05a0e8866 --- logd/LogBuffer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/logd/LogBuffer.cpp b/logd/LogBuffer.cpp index 560f490cf..b8af2f09b 100644 --- a/logd/LogBuffer.cpp +++ b/logd/LogBuffer.cpp @@ -198,7 +198,7 @@ static enum match_type identical(LogBufferElement* elem, int LogBuffer::log(log_id_t log_id, log_time realtime, uid_t uid, pid_t pid, pid_t tid, const char* msg, unsigned short len) { - if ((log_id >= LOG_ID_MAX) || (log_id < 0)) { + if (log_id >= LOG_ID_MAX) { return -EINVAL; }