Files
RedBear-OS/local
vasilito 33107cb323 firmware-loader: refactor CacheMetadata/FirmwareFallback to use named constructors
Replace ad-hoc struct literals scattered across the source with
named constructor methods (CacheMetadata::placeholder, CacheMetadata::from_source,
FirmwareFallback::load_defaults, FirmwareFallback::load_from_dir,
FirmwareFallback::builtins). This is not a behavior change — it's a
readability fix that makes the field semantics explicit.

Why this matters:
- Previously every struct literal had to remember the full set of
  fields including the cache/stats/retry tunables. Adding a new field
  required finding every literal in the source tree.
- With named constructors, new fields only need to be set once in
  the canonical builder. Test/placeholder sites stay minimal.
- Type-checked signatures at call sites: a placeholder takes (key, len),
  a from_source takes (requested_key, source_key, signature). The
  compiler now verifies you pass a SourceSignature when you need one.

Cross-referenced with Linux drivers/base/firmware_loader.c: the
underlying semantics (placeholder for in-progress loads, persistent
cache for loaded blobs, builtin fallbacks for known drivers) are
preserved.
2026-07-10 10:32:32 +03:00
..