[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1303299919.2700.26.camel@localhost>
Date: Wed, 20 Apr 2011 14:45:19 +0300
From: Artem Bityutskiy <dedekind1@...il.com>
To: Phil Carmody <ext-phil.2.carmody@...ia.com>
Cc: ext Christoph Lameter <cl@...ux.com>, akpm@...ux-foundation.org,
aarcange@...hat.com, linux-mm@...ck.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mm: make read-only accessors take const parameters
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@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists