Re: [PATCH 09/11] read-cache: require flags for `write_locked_index()`

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Martin Ågren <martin.agren@xxxxxxxxx> writes:

> ... Instead, require that one of the
> flags is set. Adjust documentation and the assert we already have for
> checking that we don't have too many flags. Add a macro `HAS_SINGLE_BIT`
> (inspired by `HAS_MULTI_BITS`) to simplify this check and similar checks
> in the future.

I do not have a strong opinion against this approach, but if
something can take only one of two values, wouldn't it make more
sense to express it as a single boolean, I wonder.  Then there is no
need to invent a cute HAS_SINGLE_BIT() macro, either.

"commit and leave it open" cannot be expressed with such a scheme,
but with the HAS_SINGLE_BIT() scheme it can't anyway, so...




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux