* [patch] netns: let net_generic take pointer-to-const args
@ 2010-11-21 4:07 Jan Engelhardt
2010-11-21 8:29 ` Eric Dumazet
2010-11-21 18:05 ` David Miller
0 siblings, 2 replies; 4+ messages in thread
From: Jan Engelhardt @ 2010-11-21 4:07 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev
parent 2801f1c311f8388ea80d78555747d449b46ea90d (v2.6.37-rc1-225-g2801f1c)
commit 381a4560f0062f5c1919f8199772d7af7281349e
Author: Jan Engelhardt <jengelh@medozas.de>
Date: Sun Nov 21 04:35:16 2010 +0100
netns: let net_generic take pointer-to-const args
This commit is same in nature as v2.6.37-rc1-755-g3654654; the network
namespace itself is not modified when calling net_generic, so the
parameter can be const.
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
---
include/net/netns/generic.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/include/net/netns/generic.h b/include/net/netns/generic.h
index 81a31c0..3419bf5 100644
--- a/include/net/netns/generic.h
+++ b/include/net/netns/generic.h
@@ -30,7 +30,7 @@ struct net_generic {
void *ptr[0];
};
-static inline void *net_generic(struct net *net, int id)
+static inline void *net_generic(const struct net *net, int id)
{
struct net_generic *ng;
void *ptr;
--
# Created with git-export-patch
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [patch] netns: let net_generic take pointer-to-const args
2010-11-21 4:07 [patch] netns: let net_generic take pointer-to-const args Jan Engelhardt
@ 2010-11-21 8:29 ` Eric Dumazet
2010-11-21 18:05 ` David Miller
2010-11-21 18:05 ` David Miller
1 sibling, 1 reply; 4+ messages in thread
From: Eric Dumazet @ 2010-11-21 8:29 UTC (permalink / raw)
To: Jan Engelhardt; +Cc: David S. Miller, netdev
Le dimanche 21 novembre 2010 à 05:07 +0100, Jan Engelhardt a écrit :
> parent 2801f1c311f8388ea80d78555747d449b46ea90d (v2.6.37-rc1-225-g2801f1c)
> commit 381a4560f0062f5c1919f8199772d7af7281349e
> Author: Jan Engelhardt <jengelh@medozas.de>
> Date: Sun Nov 21 04:35:16 2010 +0100
>
> netns: let net_generic take pointer-to-const args
>
> This commit is same in nature as v2.6.37-rc1-755-g3654654; the network
> namespace itself is not modified when calling net_generic, so the
> parameter can be const.
>
> Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
> ---
> include/net/netns/generic.h | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/include/net/netns/generic.h b/include/net/netns/generic.h
> index 81a31c0..3419bf5 100644
> --- a/include/net/netns/generic.h
> +++ b/include/net/netns/generic.h
> @@ -30,7 +30,7 @@ struct net_generic {
> void *ptr[0];
> };
>
> -static inline void *net_generic(struct net *net, int id)
> +static inline void *net_generic(const struct net *net, int id)
> {
> struct net_generic *ng;
> void *ptr;
While you are at it you could also use
const struct net_generic *ng;
Just curious, if we could use __pure attribute as well.
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [patch] netns: let net_generic take pointer-to-const args
2010-11-21 4:07 [patch] netns: let net_generic take pointer-to-const args Jan Engelhardt
2010-11-21 8:29 ` Eric Dumazet
@ 2010-11-21 18:05 ` David Miller
1 sibling, 0 replies; 4+ messages in thread
From: David Miller @ 2010-11-21 18:05 UTC (permalink / raw)
To: jengelh; +Cc: netdev
From: Jan Engelhardt <jengelh@medozas.de>
Date: Sun, 21 Nov 2010 05:07:21 +0100 (CET)
> netns: let net_generic take pointer-to-const args
>
> This commit is same in nature as v2.6.37-rc1-755-g3654654; the network
> namespace itself is not modified when calling net_generic, so the
> parameter can be const.
>
> Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Applied.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-11-21 18:05 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-21 4:07 [patch] netns: let net_generic take pointer-to-const args Jan Engelhardt
2010-11-21 8:29 ` Eric Dumazet
2010-11-21 18:05 ` David Miller
2010-11-21 18:05 ` 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).