* [PATCH net-next-2.6] rps: inet_rps_save_rxhash() argument is not const
@ 2010-04-27 12:42 Eric Dumazet
2010-04-27 19:56 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Eric Dumazet @ 2010-04-27 12:42 UTC (permalink / raw)
To: David Miller; +Cc: netdev
const qualifier on sock argument is misleading, since we can modify rxhash.
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
---
diff --git a/include/net/inet_sock.h b/include/net/inet_sock.h
index b487bc1..c1d4295 100644
--- a/include/net/inet_sock.h
+++ b/include/net/inet_sock.h
@@ -248,7 +248,7 @@ static inline void inet_rps_reset_flow(const struct sock *sk)
#endif
}
-static inline void inet_rps_save_rxhash(const struct sock *sk, u32 rxhash)
+static inline void inet_rps_save_rxhash(struct sock *sk, u32 rxhash)
{
#ifdef CONFIG_RPS
if (unlikely(inet_sk(sk)->rxhash != rxhash)) {
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net-next-2.6] rps: inet_rps_save_rxhash() argument is not const
2010-04-27 12:42 [PATCH net-next-2.6] rps: inet_rps_save_rxhash() argument is not const Eric Dumazet
@ 2010-04-27 19:56 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2010-04-27 19:56 UTC (permalink / raw)
To: eric.dumazet; +Cc: netdev
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Tue, 27 Apr 2010 14:42:51 +0200
> const qualifier on sock argument is misleading, since we can modify rxhash.
>
> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Applied.
It's a shame that because of the cast the compiler can't see this.
Instead it would be nice if the compiler only allowed casts from
a const pointer to another const pointer.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-04-27 19:56 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-27 12:42 [PATCH net-next-2.6] rps: inet_rps_save_rxhash() argument is not const Eric Dumazet
2010-04-27 19:56 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).