[edk2-devel] [PATCH v2 1/1] MdePkg: Add new JedecJep106Lib to fetch JEDEC JEP106 manufacturer

Michael D Kinney michael.d.kinney at intel.com
Fri Apr 7 23:06:44 UTC 2023


Which struct?  That macro only applies to global variables, not structure declarations.

Mike


> -----Original Message-----
> From: devel at edk2.groups.io <devel at edk2.groups.io> On Behalf Of Rebecca Cran
> Sent: Friday, April 7, 2023 3:59 PM
> To: Kinney, Michael D <michael.d.kinney at intel.com>; devel at edk2.groups.io; Liu, Zhiguang <zhiguang.liu at intel.com>; Gao, Liming
> <gaoliming at byosoft.com.cn>
> Cc: Rebecca Cran <rebecca at quicinc.com>
> Subject: Re: [edk2-devel] [PATCH v2 1/1] MdePkg: Add new JedecJep106Lib to fetch JEDEC JEP106 manufacturer
> 
> I guess GLOBAL_REMOVE_IF_UNREFERENCED should be added to the struct too?
> 
> 
> On 4/7/23 4:42 PM, Rebecca Cran wrote:
> > On 4/7/23 2:25 PM, Kinney, Michael D wrote:
> >> Comments below.
> >>
> >> Hopefully this lib would only be used by modules that get compressed.
> > I guess so, but that's for the user to decide.
> >>
> >> Might add GLOBAL_REMOVE_IF_UNREFERENCED to the arrays of strings to
> >> help the optimizer remove the data that is not referenced.
> >
> > Good idea - I'll add that.
> >
> >>> +CONST CHAR8 *
> >>> +EFIAPI
> >>> +Jep106GetManufacturerName (
> >>> +  IN UINT8  Code,
> >>> +  IN UINT8  ContinuationBytes
> >>> +  )
> >>> +{
> >>> +  UINTN                      Index;
> >>> +  CONST JEDEC_MANUFACTURERS  *ManufacturersBank;
> >>> +
> >>> +  Index = 0;
> >>> +
> >>> +  if (ContinuationBytes >= JEP106_MANUFACTURERS_NUM_BANKS) {
> >>> +    ASSERT (0);
> >> Do you really want an ASSERT() from this?  If this is data from a DIMM
> >> I doubt we want platform to ASSERT().  Perhaps just return NULL?
> > I'll remove it. I added it for validation when I was writing the SPD
> > parsing library.
> >>> +UINTN
> >>> +EFIAPI
> >>> +Jep106GetLongestManufacturerName (
> >>> +  VOID
> >>> +  )
> >> Why is this API needed?  Wouldn’t you really just need the
> >> longest of the ones present in the current boot to build the
> >> SMBIOS record?.  Not the longest of all in the banks?
> >
> > I added it because it's useful to know the maximum possible size of
> > the strings that could be in the SMBIOS Type 17 table before doing the
> > SPD parsing.
> >
> > I'll remove it for now, and if it's really needed I can add it back in.
> >
> >
> 
> 
> 
> 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#102741): https://edk2.groups.io/g/devel/message/102741
Mute This Topic: https://groups.io/mt/98127673/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/leave/3943202/1813853/130120423/xyzzy [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-




More information about the edk2-devel-archive mailing list