oxidecomputer / amd-apcb

AMD Generic Encapsulated Software Architecture Platform Security Processor Configuration Block manipulation library
Mozilla Public License 2.0
13 stars 1 forks source link

ondisk: Make make_bitfield_serde not default fields by default. #92

Closed daym closed 1 year ago

daym commented 1 year ago

Fixes https://github.com/oxidecomputer/amd-apcb/issues/91.

daym commented 1 year ago

I guess I don't know precisely what this change is doing, but it looks fine to me?

Previously, make_bitfield_serde would hardcode #[serde(default)] on all the serde struct fields. That means that you could only add fields that HAVE a default to bitfields. This was good for a long time.

The make_bitfield_serde and make_accessors macros are used in both amd-apcb and amd-efs. In amd-efs there is a case that has bitfields (Attrs) where one of the fields of it MUST NOT implement default (DirectoryEntryType).

For maintenance clarity, I also updated the definitions of make_bitfield_serde and make_accessors here in amd-apcb so both amd-apcb and amd-efs work the same in their respective implementations.

dancrossnyc commented 1 year ago

Ok, sounds legit. Ship it!