* [PATCH ipmi-fru-parser] Increase size of buffer length variable @ 2016-05-12 19:10 OpenBMC Patches 2016-05-12 19:10 ` OpenBMC Patches 0 siblings, 1 reply; 4+ messages in thread From: OpenBMC Patches @ 2016-05-12 19:10 UTC (permalink / raw) To: openbmc The latest Barreleye vpd contains additional custom fields in one of the board sections, pushing the size of the section to over 0x100. The current variable that stores the buffer size is set to be uint8_t which doesn't fit the extended size. Changing it to uint32_t. Signed-off-by: Adriana Kobylak <anoo@us.ibm.com> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/openbmc/ipmi-fru-parser/15) <!-- Reviewable:end --> https://github.com/openbmc/ipmi-fru-parser/pull/15 Adriana Kobylak (1): Increase size of buffer length variable fru-area.H | 4 ++-- frup.c | 2 +- frup.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) -- 2.8.1 ^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH ipmi-fru-parser] Increase size of buffer length variable 2016-05-12 19:10 [PATCH ipmi-fru-parser] Increase size of buffer length variable OpenBMC Patches @ 2016-05-12 19:10 ` OpenBMC Patches 2016-05-13 13:51 ` Adriana Kobylak 0 siblings, 1 reply; 4+ messages in thread From: OpenBMC Patches @ 2016-05-12 19:10 UTC (permalink / raw) To: openbmc From: Adriana Kobylak <anoo@us.ibm.com> The latest Barreleye vpd contains additional custom fields in one of the board sections, pushing the size of the buffer over 0x100. The current variable that stores the buffer size is set to be uint8_t which doesn't fit the extended size. Changing it to uint32_t. Signed-off-by: Adriana Kobylak <anoo@us.ibm.com> --- fru-area.H | 4 ++-- frup.c | 2 +- frup.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/fru-area.H b/fru-area.H index 82206bb..058e438 100644 --- a/fru-area.H +++ b/fru-area.H @@ -26,7 +26,7 @@ class ipmi_fru std::string iv_name; // Length of a specific fru area. - size_t iv_len; + uint32_t iv_len; // Special bit for BMC readable eeprom only. bool iv_bmc_fru; @@ -94,7 +94,7 @@ class ipmi_fru } // Returns the length. - size_t get_len() const + uint32_t get_len() const { return iv_len; } diff --git a/frup.c b/frup.c index 7bdf35f..4df7266 100644 --- a/frup.c +++ b/frup.c @@ -948,7 +948,7 @@ parse_fru (const void* msgbuf, sd_bus_message* vpdtbl) return (rv); } -int parse_fru_area (const uint8_t area, const void* msgbuf, const uint8_t len, sd_bus_message* vpdtbl) +int parse_fru_area (const uint8_t area, const void* msgbuf, const uint32_t len, sd_bus_message* vpdtbl) { int ret = 0; int rv = -1; diff --git a/frup.h b/frup.h index 8400951..094d223 100644 --- a/frup.h +++ b/frup.h @@ -10,7 +10,7 @@ extern "C" /* Parse an IPMI write fru data message into a dictionary containing name value pair of VPD entries.*/ int parse_fru (const void* msgbuf, sd_bus_message* vpdtbl); -int parse_fru_area (const uint8_t area, const void* msgbuf, const uint8_t len, sd_bus_message* vpdtbl); +int parse_fru_area (const uint8_t area, const void* msgbuf, const uint32_t len, sd_bus_message* vpdtbl); #ifdef __cplusplus } -- 2.8.1 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH ipmi-fru-parser] Increase size of buffer length variable 2016-05-12 19:10 ` OpenBMC Patches @ 2016-05-13 13:51 ` Adriana Kobylak 2016-05-16 0:53 ` Stewart Smith 0 siblings, 1 reply; 4+ messages in thread From: Adriana Kobylak @ 2016-05-13 13:51 UTC (permalink / raw) To: OpenBMC Patches; +Cc: openbmc [-- Attachment #1: Type: text/plain, Size: 3509 bytes --] 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. From: Daniel Axtens <notifications@github.com> To: openbmc/ipmi-fru-parser <ipmi-fru-parser@noreply.github.com> Cc: Adriana Kobylak/Austin/IBM@IBMUS, Author <author@noreply.github.com> Date: 05/12/2016 06:16 PM Subject: Re: [openbmc/ipmi-fru-parser] Increase size of buffer length variable (#15) In frup.c: > @@ -948,7 +948,7 @@ parse_fru (const void* msgbuf, sd_bus_message* vpdtbl) > return (rv); > } > > -int parse_fru_area (const uint8_t area, const void* msgbuf, const uint8_t len, sd_bus_message* vpdtbl) > +int parse_fru_area (const uint8_t area, const void* msgbuf, const uint32_t len, sd_bus_message* vpdtbl) Is there any reason we couldn't standardise on size_t here? OpenBMC Patches <openbmc-patches@stwcx.xyz> wrote on 05/12/2016 02:10:19 PM: > From: OpenBMC Patches <openbmc-patches@stwcx.xyz> > To: openbmc@lists.ozlabs.org > Cc: Adriana Kobylak/Austin/IBM@IBMUS > Date: 05/12/2016 02:10 PM > Subject: [PATCH ipmi-fru-parser] Increase size of buffer length variable > > From: Adriana Kobylak <anoo@us.ibm.com> > > The latest Barreleye vpd contains additional custom fields in one > of the board sections, pushing the size of the buffer over 0x100. > > The current variable that stores the buffer size is set to be > uint8_t which doesn't fit the extended size. Changing it to uint32_t. > > Signed-off-by: Adriana Kobylak <anoo@us.ibm.com> > --- > fru-area.H | 4 ++-- > frup.c | 2 +- > frup.h | 2 +- > 3 files changed, 4 insertions(+), 4 deletions(-) > > diff --git a/fru-area.H b/fru-area.H > index 82206bb..058e438 100644 > --- a/fru-area.H > +++ b/fru-area.H > @@ -26,7 +26,7 @@ class ipmi_fru > std::string iv_name; > > // Length of a specific fru area. > - size_t iv_len; > + uint32_t iv_len; > > // Special bit for BMC readable eeprom only. > bool iv_bmc_fru; > @@ -94,7 +94,7 @@ class ipmi_fru > } > > // Returns the length. > - size_t get_len() const > + uint32_t get_len() const > { > return iv_len; > } > diff --git a/frup.c b/frup.c > index 7bdf35f..4df7266 100644 > --- a/frup.c > +++ b/frup.c > @@ -948,7 +948,7 @@ parse_fru (const void* msgbuf, sd_bus_message* vpdtbl) > return (rv); > } > > -int parse_fru_area (const uint8_t area, const void* msgbuf, const > uint8_t len, sd_bus_message* vpdtbl) > +int parse_fru_area (const uint8_t area, const void* msgbuf, const > uint32_t len, sd_bus_message* vpdtbl) > { > int ret = 0; > int rv = -1; > diff --git a/frup.h b/frup.h > index 8400951..094d223 100644 > --- a/frup.h > +++ b/frup.h > @@ -10,7 +10,7 @@ extern "C" > > /* Parse an IPMI write fru data message into a dictionary > containing name value pair of VPD entries.*/ > int parse_fru (const void* msgbuf, sd_bus_message* vpdtbl); > -int parse_fru_area (const uint8_t area, const void* msgbuf, const > uint8_t len, sd_bus_message* vpdtbl); > +int parse_fru_area (const uint8_t area, const void* msgbuf, const > uint32_t len, sd_bus_message* vpdtbl); > > #ifdef __cplusplus > } > -- > 2.8.1 > > [-- Attachment #2: Type: text/html, Size: 5323 bytes --] ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH ipmi-fru-parser] Increase size of buffer length variable 2016-05-13 13:51 ` Adriana Kobylak @ 2016-05-16 0:53 ` Stewart Smith 0 siblings, 0 replies; 4+ messages in thread From: Stewart Smith @ 2016-05-16 0:53 UTC (permalink / raw) To: Adriana Kobylak, OpenBMC Patches; +Cc: openbmc Adriana Kobylak <anoo@us.ibm.com> writes: > 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. If size_t is part of a binary format, then yes, this matters. Otherwise, it really shouldn't - addressing things >2GB on 32bit systems is going to be problematic anyway, and all that really should matter there is off_t vs off64_t if you're doing seeking in large files. So what exactly is the problem with size_t here? -- Stewart Smith OPAL Architect, IBM. ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-05-16 0:53 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2016-05-12 19:10 [PATCH ipmi-fru-parser] Increase size of buffer length variable OpenBMC Patches 2016-05-12 19:10 ` OpenBMC Patches 2016-05-13 13:51 ` Adriana Kobylak 2016-05-16 0:53 ` Stewart Smith
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.