Context
Per the design decision on home #39, the Home compiler keeps strict typing for the logical-not operator: ! is only valid on bool and optional types. C-style truthiness (!some_u32 meaning "is zero", !some_ptr meaning "is null") is rejected at type-check time as error: Logical not requires boolean or optional operand.
The 2026-05-06 kernel audit found four kernel modules using the C-style pattern. They need a codemod to the explicit form.
Affected files
From the 2026-05-06 audit (first_error = Logical not requires boolean or optional operand):
kernel/src/arch/arm64/rpi/boot.homekernel/src/arch/arm64/rpi/emmc.homekernel/src/arch/arm64/rpi/gic400.homekernel/src/arch/arm64/rpi/mailbox.home
Recommended rewrites
| Before | After |
|---|---|
!some_u32 | some_u32 == 0 |
!some_i32 | some_i32 == 0 |
!some_ptr (raw *T) | some_ptr == null |
!some_optional | leave as-is — !Optional is already valid |
Walk each call-site manually; the integer-vs-pointer distinction matters for the chosen comparator.
Reference
- Design call on home #39: option 2 (codemod kernel, not change compiler).
- Compiler keeps the strict-typing posture in line with Home's "explicit init" / Zig-philosophy direction.