frudevice: align readFromEeprom with readBlockData
To step closer to refactoring the FRU reading code, align the signatures
of the block mead methods.
Tested: This patch was not tested.
Signed-off-by: Patrick Venture <venture@google.com>
Change-Id: I431037604a92d748a64d1090d349616808f796ea
diff --git a/src/FruDevice.cpp b/src/FruDevice.cpp
index 87b7d40..db04ecc 100644
--- a/src/FruDevice.cpp
+++ b/src/FruDevice.cpp
@@ -101,8 +101,8 @@
}
}
-static ssize_t readFromEeprom(int fd, uint16_t offset, uint8_t len,
- uint8_t* buf)
+static int readFromEeprom(int flag __attribute__((unused)), int fd,
+ uint16_t offset, uint8_t len, uint8_t* buf)
{
auto result = lseek(fd, offset, SEEK_SET);
if (result < 0)
@@ -111,7 +111,7 @@
return -1;
}
- return read(fd, buf, len);
+ return static_cast<int>(read(fd, buf, len));
}
static bool isMuxBus(size_t bus)
@@ -250,7 +250,7 @@
return device;
}
- ssize_t readBytes = readFromEeprom(file, 0, 0x8, blockData.data());
+ int readBytes = readFromEeprom(0, file, 0, 0x8, blockData.data());
if (readBytes < 0)
{
std::cerr << "failed to read eeprom at " << bus << " address "
@@ -286,7 +286,7 @@
areaOffset *= 8;
- if (readFromEeprom(file, static_cast<uint16_t>(areaOffset), 0x2,
+ if (readFromEeprom(0, file, static_cast<uint16_t>(areaOffset), 0x2,
blockData.data()) < 0)
{
std::cerr << "failed to read bus " << bus << " address " << address
@@ -311,7 +311,7 @@
{
int requestLength = std::min(I2C_SMBUS_BLOCK_MAX, fruLength);
- if (readFromEeprom(file, static_cast<uint16_t>(readOffset),
+ if (readFromEeprom(0, file, static_cast<uint16_t>(readOffset),
static_cast<uint8_t>(requestLength),
blockData.data()) < 0)
{