Sjur BRENDELAND <sjur.brandel...@stericsson.com> writes: >> This allocates one redundant sg entry when nrbuf > 0, >> but I think it is OK. (just a comment) > > I did this on purpose for the sake of simplicity, but I can > change this to something like: > alloc_size = sizeof(*buf) + sizeof(buf->sg) * max(nrbufs - 1, 1);
That's why we use [0] in the definition (a GCC extension). Cheers, Rusty. -- 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/