public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Michael D Kinney" <michael.d.kinney@intel.com>
To: Rebecca Cran <rebecca@bsdio.com>,
	"devel@edk2.groups.io" <devel@edk2.groups.io>,
	"Liu, Zhiguang" <zhiguang.liu@intel.com>,
	"Gao, Liming" <gaoliming@byosoft.com.cn>
Cc: Rebecca Cran <rebecca@quicinc.com>,
	"Kinney, Michael D" <michael.d.kinney@intel.com>
Subject: Re: [edk2-devel] [PATCH v2 1/1] MdePkg: Add new JedecJep106Lib to fetch JEDEC JEP106 manufacturer
Date: Fri, 7 Apr 2023 23:18:42 +0000	[thread overview]
Message-ID: <CO1PR11MB4929227C77693F719E990613D2969@CO1PR11MB4929.namprd11.prod.outlook.com> (raw)
In-Reply-To: <ebd74d6f-4bf0-3a92-50e2-5baf3ec89ceb@bsdio.com>

Yes.  That would be good to add to as well.

Mike

> -----Original Message-----
> From: Rebecca Cran <rebecca@bsdio.com>
> Sent: Friday, April 7, 2023 4:11 PM
> To: devel@edk2.groups.io; Kinney, Michael D <michael.d.kinney@intel.com>; Liu, Zhiguang <zhiguang.liu@intel.com>; Gao, Liming
> <gaoliming@byosoft.com.cn>
> Cc: Rebecca Cran <rebecca@quicinc.com>
> Subject: Re: [edk2-devel] [PATCH v2 1/1] MdePkg: Add new JedecJep106Lib to fetch JEDEC JEP106 manufacturer
> 
> Sorry, not the struct - the array:
> 
> 
> STATIC CONST JEDEC_MANUFACTURERS *Jep106Manufacturers[] = {
>    Jep106ManufacturersBank1,
>    Jep106ManufacturersBank2,
>    Jep106ManufacturersBank3,
>    Jep106ManufacturersBank4,
>    Jep106ManufacturersBank5,
>    Jep106ManufacturersBank6,
>    Jep106ManufacturersBank7,
>    Jep106ManufacturersBank8,
>    Jep106ManufacturersBank9,
>    Jep106ManufacturersBank10,
>    Jep106ManufacturersBank11,
>    Jep106ManufacturersBank12,
>    Jep106ManufacturersBank13,
>    Jep106ManufacturersBank14
> };
> 
> On 4/7/23 5:06 PM, Michael D Kinney wrote:
> > Which struct?  That macro only applies to global variables, not structure declarations.
> >
> > Mike
> >
> >
> >> -----Original Message-----
> >> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Rebecca Cran
> >> Sent: Friday, April 7, 2023 3:59 PM
> >> To: Kinney, Michael D <michael.d.kinney@intel.com>; devel@edk2.groups.io; Liu, Zhiguang <zhiguang.liu@intel.com>; Gao, Liming
> >> <gaoliming@byosoft.com.cn>
> >> Cc: Rebecca Cran <rebecca@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.
> >>>
> >>>
> >>
> >>
> >>
> >
> >
> > 
> >
> >

      reply	other threads:[~2023-04-07 23:18 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-07 16:19 [PATCH v2 0/1] MdePkg: Add new JedecJep106Lib to fetch JEDEC JEP106 manufacturer Rebecca Cran
2023-04-07 16:19 ` [PATCH v2 1/1] " Rebecca Cran
2023-04-07 20:25   ` Michael D Kinney
2023-04-07 22:42     ` Rebecca Cran
     [not found]     ` <1753C85A6247B7C4.11060@groups.io>
2023-04-07 22:58       ` [edk2-devel] " Rebecca Cran
2023-04-07 23:06         ` Michael D Kinney
2023-04-07 23:10           ` Rebecca Cran
2023-04-07 23:18             ` Michael D Kinney [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CO1PR11MB4929227C77693F719E990613D2969@CO1PR11MB4929.namprd11.prod.outlook.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox