On May 25, 2026, at 15:58, Joshua Peisach [off-list ref] wrote:
On Mon May 25, 2026 at 8:11 AM EDT, Sasha Finkelstein wrote:
quoted
+ cmd.enable = !!enable;
+
Probably a dumb question, but worth asking - what is the purpose of the
"!!"? Wouldn't just passing "enable" be sufficient?
This is a way to enforce that the value is exactly 0 or 1, not 0 or non-zero.
Also, currently, cmd.enable seems to just be set and used in the case
of boolean conditions. Would it make sense for the enable field in
brcm_prio_cmd to be a bool or does it not really matter?
Opposite, actually, this struct is fed to firmware, and it needs to be
specifically a u8.