Thread (6 messages) flat view 6 messages, 3 authors, 2011-12-16

Re: [PATCH] phylib: update mdiobus_alloc() to allocate extra private space

From: David Miller <davem@davemloft.net>
Date: 2011-12-16 20:33:59
Also in: netdev

From: Timur Tabi <redacted>
Date: Thu, 15 Dec 2011 11:12:01 -0600
Andy Fleming wrote:
quoted
Why? Doesn't this just obfuscate things a little, while providing no immediate benefit?
I see code like this frequently:

	bus = mdiobus_alloc();
	if (bus == NULL)
		return -ENOMEM;
	priv = kzalloc(sizeof(*priv), GFP_KERNEL);
	if (priv == NULL) {
		err = -ENOMEM;
		goto out_free;
	}
	bus->priv = priv;
Where "frequently", all of the mdiobus_alloc() call sites in your patch just
get translated to pass "0" for the private size.

Make the change how I suggested, where mdiobus_alloc() retains it's current
function signature and semantics.  Then you can edit drivers as needed rather
than from the beginning.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help