Clang-tidy-14 fixes
Do as the robot commands. All changes made automatically by tidy.
Tested: (Thanks Zhikui)
Downloaded and run on system. Sensors scan normally.
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I752f37c9e7a95aa3be8e6980ba6e4b2b48b3395a
diff --git a/src/NVMeBasicContext.cpp b/src/NVMeBasicContext.cpp
index 760167e..88ddfe8 100644
--- a/src/NVMeBasicContext.cpp
+++ b/src/NVMeBasicContext.cpp
@@ -122,7 +122,7 @@
{
std::cerr << "Failed to read request from in descriptor "
<< strerror(errno) << "\n";
- if (rc)
+ if (rc != 0)
{
return -errno;
}
@@ -158,7 +158,7 @@
std::cerr << "Failed to write block (" << std::dec << len
<< ") length to out descriptor: "
<< strerror(static_cast<int>(-rc)) << "\n";
- if (rc)
+ if (rc != 0)
{
return -errno;
}
@@ -176,7 +176,7 @@
std::cerr << "Failed to write block data of length " << std::dec
<< lenRemaining << " to out pipe: " << strerror(errno)
<< "\n";
- if (rc)
+ if (rc != 0)
{
return -errno;
}
@@ -400,8 +400,8 @@
uint8_t* messageData = static_cast<uint8_t*>(msg);
uint8_t status = messageData[0];
- if ((status & NVME_MI_BASIC_SFLGS_DRIVE_NOT_READY) ||
- !(status & NVME_MI_BASIC_SFLGS_DRIVE_FUNCTIONAL))
+ if (((status & NVME_MI_BASIC_SFLGS_DRIVE_NOT_READY) != 0) ||
+ ((status & NVME_MI_BASIC_SFLGS_DRIVE_FUNCTIONAL) == 0))
{
sensor->markFunctional(false);
return;