Em Fri, Nov 22, 2013 at 03:24:26PM +0100, Jiri Olsa escreveu: > } > + > +ssize_t perf_data_file__write(struct perf_data_file *file, > + void *buf, size_t size) > +{ > + ssize_t total = size; > + > + while (size) { > + ssize_t ret = write(file->fd, buf, size); > + > + if (ret < 0) { > + pr_err("failed to write perf data, error: %m\n"); > + return -1; > + } > + > + size -= ret; > + buf += ret; > + } > + > + return total;
So this is the functional equivalent of "readn", so please move it to just after "readn" and make this just a simple wrapper. - Arnaldo -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/