Thread (7 messages) 7 messages, 3 authors, 2008-01-31

Re: [XFRM]: constify 'struct xfrm_type'

From: Eric Dumazet <hidden>
Date: 2008-01-24 19:24:22

Joe Perches a écrit :
On Thu, 2008-01-24 at 19:23 +0100, Eric Dumazet wrote:
quoted
Having const data is nice because moving them from .data to .rodata,
but what would be practical gains to use a const pointer ???
const data is good, using pointers to const data is good.
Yes, this is what is done.
using const pointers to const data is good.
const pointers are seldom used in linux kernel, because mostly useless.
using const pointers to data not specified as const is not so good.
You misread the patch. I am not using const pointers at all, but const data.


Here's what you are doing now.

+static void xfrm_put_type(const struct xfrm_type *type)
[...]
+	const struct xfrm_type *type;
Yes, this was the plan, I meant it.

I still dont understand what *you* want to do.

Doing :

int xfrm_unregister_type(const struct xfrm_type * const type, const unsigned 
short family)

instead of :

int xfrm_unregister_type(const struct xfrm_type *type, unsigned short family)

buys nothing for the caller.

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help