<font size=2 face="sans-serif">The size of size_t is different in 32 and
64-bit architectures. There has been issues in the past in op-build where
we had to change size_t to uint32_t to support compiling in 64-bit. So
thought I'd make the change consistent and change the length to uint32_t.</font><br><br><br><font size=2 face="sans-serif">From: Daniel
Axtens <notifications@github.com></font><br><font size=2 face="sans-serif">To: openbmc/ipmi-fru-parser
<ipmi-fru-parser@noreply.github.com></font><br><font size=2 face="sans-serif">Cc: Adriana
Kobylak/Austin/IBM@IBMUS, Author <author@noreply.github.com></font><br><font size=2 face="sans-serif">Date: 05/12/2016
06:16 PM</font><br><font size=2 face="sans-serif">Subject: Re:
[openbmc/ipmi-fru-parser] Increase size of buffer length variable (#15)</font><br><br><br><br><font size=2 face="sans-serif">In frup.c:</font><br><font size=2 face="sans-serif">> @@ -948,7 +948,7 @@ parse_fru (const
void* msgbuf, sd_bus_message* vpdtbl)</font><br><font size=2 face="sans-serif">> return (rv);</font><br><font size=2 face="sans-serif">> }</font><br><font size=2 face="sans-serif">> </font><br><font size=2 face="sans-serif">> -int parse_fru_area (const uint8_t
area, const void* msgbuf, const uint8_t len, sd_bus_message* vpdtbl)</font><br><font size=2 face="sans-serif">> +int parse_fru_area (const uint8_t
area, const void* msgbuf, const uint32_t len, sd_bus_message* vpdtbl)</font><br><br><font size=2 face="sans-serif">Is there any reason we couldn't standardise
on size_t here?</font><br><br><br><br><tt><font size=2>OpenBMC Patches <openbmc-patches@stwcx.xyz>
wrote on 05/12/2016 02:10:19 PM:<br><br>> From: OpenBMC Patches <openbmc-patches@stwcx.xyz></font></tt><br><tt><font size=2>> To: openbmc@lists.ozlabs.org</font></tt><br><tt><font size=2>> Cc: Adriana Kobylak/Austin/IBM@IBMUS</font></tt><br><tt><font size=2>> Date: 05/12/2016 02:10 PM</font></tt><br><tt><font size=2>> Subject: [PATCH ipmi-fru-parser] Increase size
of buffer length variable</font></tt><br><tt><font size=2>> <br>> From: Adriana Kobylak <anoo@us.ibm.com><br>> <br>> The latest Barreleye vpd contains additional custom fields in one<br>> of the board sections, pushing the size of the buffer over 0x100.<br>> <br>> The current variable that stores the buffer size is set to be<br>> uint8_t which doesn't fit the extended size. Changing it to uint32_t.<br>> <br>> Signed-off-by: Adriana Kobylak <anoo@us.ibm.com><br>> ---<br>> fru-area.H | 4 ++--<br>> frup.c | 2 +-<br>> frup.h | 2 +-<br>> 3 files changed, 4 insertions(+), 4 deletions(-)<br>> <br>> diff --git a/fru-area.H b/fru-area.H<br>> index 82206bb..058e438 100644<br>> --- a/fru-area.H<br>> +++ b/fru-area.H<br>> @@ -26,7 +26,7 @@ class ipmi_fru<br>> std::string iv_name;<br>> <br>> // Length of a specific fru area.<br>> - size_t iv_len;<br>> + uint32_t iv_len;<br>> <br>> // Special bit for BMC readable
eeprom only.<br>> bool iv_bmc_fru;<br>> @@ -94,7 +94,7 @@ class ipmi_fru<br>> }<br>> <br>> // Returns the length.<br>> - size_t get_len() const<br>> + uint32_t get_len() const<br>> {<br>> return iv_len;<br>> }<br>> diff --git a/frup.c b/frup.c<br>> index 7bdf35f..4df7266 100644<br>> --- a/frup.c<br>> +++ b/frup.c<br>> @@ -948,7 +948,7 @@ parse_fru (const void* msgbuf, sd_bus_message*
vpdtbl)<br>> return (rv);<br>> }<br>> <br>> -int parse_fru_area (const uint8_t area, const void* msgbuf, const
<br>> uint8_t len, sd_bus_message* vpdtbl)<br>> +int parse_fru_area (const uint8_t area, const void* msgbuf, const
<br>> uint32_t len, sd_bus_message* vpdtbl)<br>> {<br>> int ret = 0;<br>> int rv = -1;<br>> diff --git a/frup.h b/frup.h<br>> index 8400951..094d223 100644<br>> --- a/frup.h<br>> +++ b/frup.h<br>> @@ -10,7 +10,7 @@ extern "C"<br>> <br>> /* Parse an IPMI write fru data message into a dictionary <br>> containing name value pair of VPD entries.*/<br>> int parse_fru (const void* msgbuf, sd_bus_message* vpdtbl);<br>> -int parse_fru_area (const uint8_t area, const void* msgbuf, const
<br>> uint8_t len, sd_bus_message* vpdtbl);<br>> +int parse_fru_area (const uint8_t area, const void* msgbuf, const
<br>> uint32_t len, sd_bus_message* vpdtbl);<br>> <br>> #ifdef __cplusplus<br>> }<br>> -- <br>> 2.8.1<br>> <br>> <br></font></tt><BR>