All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Dumazet <dada1@cosmosbay.com>
To: Alexey Dobriyan <adobriyan@gmail.com>
Cc: davem@davemloft.net, netdev@vger.kernel.org
Subject: Re: [PATCH v3] net: #ifdef inet_bind_bucket::ib_net
Date: Fri, 14 Nov 2008 05:36:15 +0100	[thread overview]
Message-ID: <491D003F.7060605@cosmosbay.com> (raw)
In-Reply-To: <b6fcc0a0811131521h69419b4an102a0cee98841a83@mail.gmail.com>

Alexey Dobriyan a écrit :
>>> Something is wrong with read_pnet() as nobody suggested to mass use it
>>> or send a patch doing it.
>> I did. My plan is to zap all superflous #ifdef CONFIG_NET_NS if possible.
> 
> That's not mass usage.
> 
> Mass usage is, say, s/dev_net/read_pnet/.
> 
> Do you want to do this too?

Yes, it was present on my original first patch.
I said I was going to split the big patch.
How many mails will be necessary until you get the point ?

I was waiting *you* change "read_pnet()/write_pnet()" names as you
intended, *before* submitting new patches, in order not to
duplicate work.

For instance, I dont like :

static inline
struct net *dev_net(const struct net_device *dev)
{
#ifdef CONFIG_NET_NS
        return dev->nd_net;
#else
        return &init_net;
#endif
}


I prefer :

static inline
struct net *dev_net(const struct net_device *dev)
{
	return read_pnet(&dev->nd_net);
}

This is better because :

1) No #ifdef CONFIG_NET_NS

2) The magic about &init_net is not duplicated in ten different include files, but
   centralized in the right file : include/net/net_namespace.h



  reply	other threads:[~2008-11-14  4:36 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-13 23:21 [PATCH v3] net: #ifdef inet_bind_bucket::ib_net Alexey Dobriyan
2008-11-14  4:36 ` Eric Dumazet [this message]
2008-11-14  4:40   ` David Miller
2008-11-14  4:54     ` Eric Dumazet
2008-11-14  6:14       ` Alexey Dobriyan
2008-11-14  6:21         ` Eric Dumazet
2008-11-14  6:41           ` Alexey Dobriyan
  -- strict thread matches above, loose matches on Subject: below --
2008-11-13 22:53 Alexey Dobriyan
2008-11-13 23:03 ` David Miller
2008-11-13 23:09 ` Eric Dumazet
2008-11-11  0:44 [PATCH] net: introduce read_pnet() and write_pnet() functions David Miller
2008-11-11 11:08 ` [PATCH] net: #ifdef inet_bind_bucket::ib_net Alexey Dobriyan
2008-11-11 11:19   ` [PATCH v2] " Alexey Dobriyan
2008-11-12  0:45     ` David Miller
2008-11-12 10:44       ` Alexey Dobriyan
2008-11-12 10:50         ` Eric Dumazet
2008-11-12 12:24           ` [PATCH v3] " Alexey Dobriyan
2008-11-12 12:24             ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=491D003F.7060605@cosmosbay.com \
    --to=dada1@cosmosbay.com \
    --cc=adobriyan@gmail.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.