I wonder if there's a way to make this BUILD_BUG_ON(), so the problem iscaught at compile time (a change like adding an O_ flag is often compiletested only for obscure archs). One could create a compile-timemacro-ized version of hweight32() and use that, I guess, although I'mnot sure it's worth the ugliness.

Failing that maybe this should be WARN_ON()? I'd be annoyed if my archwouldn't boot because some strange new O_ flag happened to collide.