On Thu, 2012-07-05 at 23:44 -0700, David Miller wrote:
From: Eric Dumazet <redacted>
Date: Fri, 06 Jul 2012 08:41:47 +0200
quoted
David, what do you think if I submit a patch using following accessor ?
/* get a rt6_info given a dst_entry pointer */
static inline struct rt6_info *dst_rt6_info(struct dst_entry *dst)
{
return (struct rt6_info *)dst;
}
I'd rather we simply not use address-of pointers in our interfaces
like we do now in some spots.
99 times out of 100 it's a case where PTR_ERR() would do.
I spent a lot of time moving both ipv4 and ipv6 in this direction,
we're almost there, and should simply finish off the remaining
cases.
Not sure what you mean. I dont use address of pointer.
I suggested a type safe thing
ie change all
struct rt6_info *rt = (struct rt6_info *)dst;
by
struct rt6_info *rt = dst_rt6_info(dst);
same generated code, but we have compiler checks instead of a raw cast.