mirror of
https://gitlab.com/qemu-project/qemu.git
synced 2026-08-26 22:23:12 -04:00
Explicitly initialize more fields which are complex structures. For simple types (bool/u32/usize), they can be omitted since C has already initialized memory to all zeros and this is the valid initialization for those simple types. Previously such complex fields (InterruptSource/BqlCell/BqlRefCell) were not explicitly initialized in init() and it's fine, because simply setting all memory to zero aligns with their default initialization behavior. However, this behavior is not robust. When adding new complex struct or modifying the initial values of existing structs, this default behavior can easily be broken. Thus, do explicit initialization for HPET to become a good example. Signed-off-by: Zhao Liu <zhao1.liu@intel.com> Link: https://lore.kernel.org/r/20251113051937.4017675-16-zhao1.liu@intel.com Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> |
||
|---|---|---|
| .. | ||
| bits | ||
| bql | ||
| chardev | ||
| common | ||
| hw | ||
| migration | ||
| qemu-macros | ||
| qom | ||
| system | ||
| tests | ||
| trace | ||
| util | ||
| .gitignore | ||
| Cargo.lock | ||
| Cargo.toml | ||
| Kconfig | ||
| meson.build | ||
| rustfmt.toml | ||