On Mon, Oct 16, 2017 at 01:09:04AM +0300, Timofey Titovets wrote: > May be then just add a comment at least at one of that functions? > Like: > /* > * Handle unaligned end, end is inclusive, so always unaligned > */
This would be best documented in the data structure definition, so we don't have to comment each and every test that compares something against the range. > Or something like: > /* > * It's obvious, kernel use paging, so range > * Almost always have aligned start like 0 > * and unaligned end like 8192 - 1 > */ > > Or we assume that everybody who look at kernel code, must understood > that basic things? Some level of understanding is required of course, but it's different for everybody. If the semantics or constraints of code/structures are not discoverable, then it should be documented. Adding comment-only patches is ok, but adding trivial or commenting on the obvious is pointless. IME the sense of what is/not trivial comes after reading a lot of code. -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html