On Fri, Apr 11, 2008 at 08:21:06AM +0200, Uwe Kleine-König wrote:
All right, I won't argue about this one. If you like it, use it.
OK, as this is a generic driver where we don't know what crap people
will pass in, it might be justified. OK.
No. It's more important to see which variables are declared in the
function and which are declared elsewhere. If you have to search the
whole body of a function for possible declarations, this is BAD. And if
it's not clear where a variable is used, the function is too long or has
other style problems. Your function is short and clean, so where's the
problem? Please move the declaration to the top of the function.
I don't like it. It makes things more complicated without any obvious
gain. sizeof(struct uio_info) would return wrong values, you need to
free the extra memory, userspace applications need to be able to deal
with 10000 mappings...
If there's an actual usecase where 5 mappings are not enough, we can
talk about increasing MAX_UIO_MAPS to some other value.
As I said above, feel free to use it.
As I said, it looks OK here. You can keep it if you like it.
I'd like to thank you for your work. After giving it some thought, I
really like the idea of having a generic UIO driver for platform
devices. I think many people (including /me) will use it. So, please send
an updated patch, I think we should push it to mainline.
Thanks,
Hans
--