> #endif > - if (length <= 0) > + if (length < 0) { > return -EINVAL; > + } > + > start = offset & ~(s->cluster_size - 1); > last = (offset + length - 1) & ~(s->cluster_size - 1); > for(cluster_offset = start; cluster_offset <= last;
So for legnth = 0, last will equal start and we'll never go through the loop. But should we really bother with all the other work in the function or just return 0 early on?