netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-2.6.25 0/4] Convert IP4 address class macros to inline functions
@ 2007-11-14 15:53 Joe Perches
  0 siblings, 0 replies; 6+ messages in thread
From: Joe Perches @ 2007-11-14 15:53 UTC (permalink / raw)
  To: David Miller
  Cc: netdev, Pekka Savola (ipv6), Alexey Kuznetsov, Hideaki YOSHIFUJI,
	James Morris, Patrick McHardy

Change LOOPBACK MULTICAST LOCAL_MCAST BADCLASS and ZERONET
macros to inline functions is_ip4_[type](__be32 addr)
Adds some type safety and maybe some readability

No change in compiled image size

Signed-off-by: Joe Perches <joe@perches.com>



^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH net-2.6.25 0/4] Convert IP4 address class macros to inline functions
@ 2007-11-20  6:40 Joe Perches
  2007-11-20  7:06 ` Simon Horman
  0 siblings, 1 reply; 6+ messages in thread
From: Joe Perches @ 2007-11-20  6:40 UTC (permalink / raw)
  To: David Miller
  Cc: netdev, Pekka Savola (ipv6), Alexey Kuznetsov, Hideaki YOSHIFUJI,
	James Morris, Patrick McHardy

Change LOOPBACK MULTICAST LOCAL_MCAST BADCLASS and ZERONET
macros to inline functions ipv4_is_<type>(__be32 addr)

Adds some type safety and arguably some readability

No change in compiled image size

Signed-off-by: Joe Perches <joe@perches.com>



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH net-2.6.25 0/4] Convert IP4 address class macros to inline functions
  2007-11-20  6:40 Joe Perches
@ 2007-11-20  7:06 ` Simon Horman
  2007-11-20  7:18   ` Joe Perches
  0 siblings, 1 reply; 6+ messages in thread
From: Simon Horman @ 2007-11-20  7:06 UTC (permalink / raw)
  To: Joe Perches
  Cc: David Miller, netdev, Pekka Savola (ipv6), Alexey Kuznetsov,
	Hideaki YOSHIFUJI, James Morris, Patrick McHardy

On Mon, Nov 19, 2007 at 10:40:12PM -0800, Joe Perches wrote:
> Change LOOPBACK MULTICAST LOCAL_MCAST BADCLASS and ZERONET
> macros to inline functions ipv4_is_<type>(__be32 addr)
> 
> Adds some type safety and arguably some readability
> 
> No change in compiled image size
> 
> Signed-off-by: Joe Perches <joe@perches.com>

I can understand the motivation for moving the functionality into
inline functions in order to get some type safety. But what is
the motivation for changing all the macro calls to function calls,
when you have set up the marcos to call the appropriate functions?
Surely if you want to do that you should just ditch the marcos all
together. Perhaps I am missing a patch?

Also, as the function names are longer than the macro name
you are creating lines that are > 80 columns wide that used
not to be in that state. For my eyes that reduced readability
(substantially).

-- 
Horms


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH net-2.6.25 0/4] Convert IP4 address class macros to inline functions
  2007-11-20  7:06 ` Simon Horman
@ 2007-11-20  7:18   ` Joe Perches
  2007-11-20  7:42     ` Simon Horman
  2007-11-20  8:03     ` David Miller
  0 siblings, 2 replies; 6+ messages in thread
From: Joe Perches @ 2007-11-20  7:18 UTC (permalink / raw)
  To: Simon Horman
  Cc: David Miller, netdev, Pekka Savola (ipv6), Alexey Kuznetsov,
	Hideaki YOSHIFUJI, James Morris, Patrick McHardy

On Tue, 2007-11-20 at 16:06 +0900, Simon Horman wrote:
> On Mon, Nov 19, 2007 at 10:40:12PM -0800, Joe Perches wrote:
> > Change LOOPBACK MULTICAST LOCAL_MCAST BADCLASS and ZERONET
> > macros to inline functions ipv4_is_<type>(__be32 addr)
> > Adds some type safety and arguably some readability
> > No change in compiled image size
> > Signed-off-by: Joe Perches <joe@perches.com>
> I can understand the motivation for moving the functionality into
> inline functions in order to get some type safety. But what is
> the motivation for changing all the macro calls to function calls,
> when you have set up the marcos to call the appropriate functions?

It's just a sequence that allows the kernel to compile.

I expect to remove the macros when the other callsites,
drivers/infiniband and drivers/parisc, are converted.

> Surely if you want to do that you should just ditch the marcos all
> together. Perhaps I am missing a patch?

That's what I'd like to do but in sequence.

David Miller can reasonably accept the net changes, but
I'm not too sure he can accept the drivers changes.

If/when this change is accepted and patches for drivers are
accepted, I'll submit a patch to remove the macros.

> Also, as the function names are longer than the macro name
> you are creating lines that are > 80 columns wide that used
> not to be in that state. For my eyes that reduced readability
> (substantially).

David? You want a patch for that too?


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH net-2.6.25 0/4] Convert IP4 address class macros to inline functions
  2007-11-20  7:18   ` Joe Perches
@ 2007-11-20  7:42     ` Simon Horman
  2007-11-20  8:03     ` David Miller
  1 sibling, 0 replies; 6+ messages in thread
From: Simon Horman @ 2007-11-20  7:42 UTC (permalink / raw)
  To: Joe Perches
  Cc: David Miller, netdev, Pekka Savola (ipv6), Alexey Kuznetsov,
	Hideaki YOSHIFUJI, James Morris, Patrick McHardy

On Mon, Nov 19, 2007 at 11:18:44PM -0800, Joe Perches wrote:
> On Tue, 2007-11-20 at 16:06 +0900, Simon Horman wrote:
> > On Mon, Nov 19, 2007 at 10:40:12PM -0800, Joe Perches wrote:
> > > Change LOOPBACK MULTICAST LOCAL_MCAST BADCLASS and ZERONET
> > > macros to inline functions ipv4_is_<type>(__be32 addr)
> > > Adds some type safety and arguably some readability
> > > No change in compiled image size
> > > Signed-off-by: Joe Perches <joe@perches.com>
> > I can understand the motivation for moving the functionality into
> > inline functions in order to get some type safety. But what is
> > the motivation for changing all the macro calls to function calls,
> > when you have set up the marcos to call the appropriate functions?
> 
> It's just a sequence that allows the kernel to compile.
> 
> I expect to remove the macros when the other callsites,
> drivers/infiniband and drivers/parisc, are converted.
> 
> > Surely if you want to do that you should just ditch the marcos all
> > together. Perhaps I am missing a patch?
> 
> That's what I'd like to do but in sequence.
> 
> David Miller can reasonably accept the net changes, but
> I'm not too sure he can accept the drivers changes.
> 
> If/when this change is accepted and patches for drivers are
> accepted, I'll submit a patch to remove the macros.

Thanks for the clarification. I realised after I sent my
mail that you were probably having to cope with other callers.

> > Also, as the function names are longer than the macro name
> > you are creating lines that are > 80 columns wide that used
> > not to be in that state. For my eyes that reduced readability
> > (substantially).
> 
> David? You want a patch for that too?

-- 
Horms


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH net-2.6.25 0/4] Convert IP4 address class macros to inline functions
  2007-11-20  7:18   ` Joe Perches
  2007-11-20  7:42     ` Simon Horman
@ 2007-11-20  8:03     ` David Miller
  1 sibling, 0 replies; 6+ messages in thread
From: David Miller @ 2007-11-20  8:03 UTC (permalink / raw)
  To: joe; +Cc: horms, netdev, pekkas, kuznet, yoshfuji, jmorris, kaber

From: Joe Perches <joe@perches.com>
Date: Mon, 19 Nov 2007 23:18:44 -0800

> On Tue, 2007-11-20 at 16:06 +0900, Simon Horman wrote:
> > Also, as the function names are longer than the macro name
> > you are creating lines that are > 80 columns wide that used
> > not to be in that state. For my eyes that reduced readability
> > (substantially).
> 
> David? You want a patch for that too?

These patches are just clumsy and awkward, this much I will
say.

BTW, these seemingly odd macro names come from BSD.
Terefore they are quite readable for many of us :-)

I don't know what to do with these patches, they feel like
just plain noise to me even though I like the type checking.

I'm going to defer for now, sorry.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2007-11-20  8:03 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-14 15:53 [PATCH net-2.6.25 0/4] Convert IP4 address class macros to inline functions Joe Perches
  -- strict thread matches above, loose matches on Subject: below --
2007-11-20  6:40 Joe Perches
2007-11-20  7:06 ` Simon Horman
2007-11-20  7:18   ` Joe Perches
2007-11-20  7:42     ` Simon Horman
2007-11-20  8:03     ` 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).