From: David Miller <davem@davemloft.net>
To: timur@freescale.com
Cc: netdev@vger.kernel.org, afleming@freescale.com, linuxppc-dev@ozlabs.org
Subject: Re: [PATCH] phylib: update mdiobus_alloc() to allocate extra private space
Date: Fri, 16 Dec 2011 15:32:54 -0500 (EST) [thread overview]
Message-ID: <20111216.153254.1998330487051662169.davem@davemloft.net> (raw)
In-Reply-To: <4EEA2A61.8050302@freescale.com>
From: Timur Tabi <timur@freescale.com>
Date: Thu, 15 Dec 2011 11:12:01 -0600
> Andy Fleming wrote:
>> 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.
next prev parent reply other threads:[~2011-12-16 20:33 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-15 16:51 [PATCH] phylib: update mdiobus_alloc() to allocate extra private space Timur Tabi
2011-12-15 17:06 ` Andy Fleming
2011-12-15 17:12 ` Timur Tabi
2011-12-16 20:32 ` David Miller [this message]
2011-12-16 20:37 ` Timur Tabi
2011-12-16 20:31 ` 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=20111216.153254.1998330487051662169.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=afleming@freescale.com \
--cc=linuxppc-dev@ozlabs.org \
--cc=netdev@vger.kernel.org \
--cc=timur@freescale.com \
/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 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).