Messages in this thread | | | Subject | Re: [PATCH] mm: make read-only accessors take const parameters | From | Artem Bityutskiy <> | Date | Wed, 20 Apr 2011 14:45:19 +0300 |
| |
On Fri, 2011-04-15 at 19:07 +0300, Phil Carmody wrote: > Not in C, alas. As it returns what it's given I wouldn't want it to > lie > about the type of what it returns, and some of its clients want it to > return something writeable.
I think this little lie is prettier than _ro variants of functions. I do not think you'll go far with your 'const' quest if you start adding _ro variants for different core functions, but if you just cast the return pointer to non-const you might be more successful.
-- Best Regards, Artem Bityutskiy (Артём Битюцкий)
-- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |