[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20111021.033648.1029307040209750463.davem@davemloft.net>
Date: Fri, 21 Oct 2011 03:36:48 -0400 (EDT)
From: David Miller <davem@...emloft.net>
To: eric.dumazet@...il.com
Cc: netdev@...r.kernel.org
Subject: Re: [PATCH net-next] tcp: add const qualifiers where possible
From: David Miller <davem@...hat.com>
Date: Fri, 21 Oct 2011 02:55:49 -0400 (EDT)
> From: Eric Dumazet <eric.dumazet@...il.com>
> Date: Fri, 21 Oct 2011 08:53:13 +0200
>
>> Adding const qualifiers to pointers can ease code review, and spot some
>> bugs. It might allow compiler to optimize code further.
>>
>> For example, is it legal to temporary write a null cksum into tcphdr
>> in tcp_md5_hash_header() ? I am afraid a sniffer could catch the
>> temporary null value...
>>
>> Signed-off-by: Eric Dumazet <eric.dumazet@...il.com>
>
> Applied.
You can't make the argument to __sk_dst_get() const, because lock_is_held()
does not take a const pointer argument.
include/net/sock.h: In function ‘__sk_dst_get’:
include/net/sock.h:1315:2: warning: passing argument 1 of ‘lock_is_held’ discards ‘const’ qualifier from pointer target type [enabled by default]
include/linux/lockdep.h:324:12: note: expected ‘struct lockdep_map *’ but argument is of type ‘const struct lockdep_map *’
I'm reverting.
Powered by blists - more mailing lists