diff options
author | Patrick Venture <venture@google.com> | 2018-10-16 17:16:32 -0700 |
---|---|---|
committer | Patrick Venture <venture@google.com> | 2018-10-16 17:16:32 -0700 |
commit | 50ddfe5eaf4afcf416253404afeddd4934d4dcab (patch) | |
tree | e5cdddd09973b4110d463a1ef9f3eebe27c52376 /writefrudata.cpp | |
parent | 48706cbe016f81b5ef9e99d9534cef009bce4daa (diff) | |
download | ipmi-fru-parser-50ddfe5eaf4afcf416253404afeddd4934d4dcab.tar.gz ipmi-fru-parser-50ddfe5eaf4afcf416253404afeddd4934d4dcab.zip |
cleanup: reduce variable scope
[writefrudata.cpp:441]: (style) The scope of the variable 'area_offset' can be reduced.
Change-Id: Idc8f7639347e5f4ad06fd15beedbe13a6181b4f1
Signed-off-by: Patrick Venture <venture@google.com>
Diffstat (limited to 'writefrudata.cpp')
-rw-r--r-- | writefrudata.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/writefrudata.cpp b/writefrudata.cpp index a6c097e..46c7729 100644 --- a/writefrudata.cpp +++ b/writefrudata.cpp @@ -438,7 +438,6 @@ bool remove_invalid_area(const std::unique_ptr<ipmi_fru> &fru_area) int ipmi_populate_fru_areas(uint8_t *fru_data, const size_t data_len, fru_area_vec_t & fru_area_vec) { - size_t area_offset = 0; int rc = -1; // Now walk the common header and see if the file size has atleast the last @@ -451,7 +450,7 @@ int ipmi_populate_fru_areas(uint8_t *fru_data, const size_t data_len, rc = -1; // Actual offset in the payload is the offset mentioned in common header // multiplied by 8. Common header is always the first 8 bytes. - area_offset = fru_data[fru_entry] * IPMI_EIGHT_BYTES; + size_t area_offset = fru_data[fru_entry] * IPMI_EIGHT_BYTES; if(area_offset && (data_len < (area_offset + 2))) { // Our file size is less than what it needs to be. +2 because we are |