Result of read() is signed
Change-Id: I6f849d5fe0ac103b571171d462052d9de6817ff1
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
diff --git a/sbe_chipOp_handler.cpp b/sbe_chipOp_handler.cpp
index b285e9a..81a24b0 100644
--- a/sbe_chipOp_handler.cpp
+++ b/sbe_chipOp_handler.cpp
@@ -26,7 +26,7 @@
size_t cmdBufLen,
size_t respBufLen)
{
- size_t len = 0;
+ ssize_t len = 0;
std::vector<sbe_word_t> response;
std::ostringstream errMsg;
@@ -84,7 +84,7 @@
//Create a temporary buffer
std::vector<sbe_word_t> buffer(totalReadLen);
- auto bytesToRead = (totalReadLen * WORD_SIZE);
+ ssize_t bytesToRead = (totalReadLen * WORD_SIZE);
len = read(fileFd(), buffer.data(), bytesToRead);
if (len < 0)
{