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

2011-12-16 Thread Timur Tabi
David Miller wrote: > 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. Yes, your approach makes much more sense. I should have thought of it. -- Timur Tabi Linux

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

2011-12-16 Thread David Miller
From: Timur Tabi 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 -ENOM

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

2011-12-16 Thread David Miller
From: Timur Tabi Date: Thu, 15 Dec 2011 10:51:35 -0600 > Augment mdiobus_alloc() to take a parameter indicating the number of extra > bytes to allocate for private data. Almost all callers of mdiobus_alloc() > separately allocate a private data structure. By allowing mdiobus_alloc() > to alloca

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

2011-12-15 Thread Timur Tabi
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 (

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

2011-12-15 Thread Andy Fleming
On Dec 15, 2011, at 11:51 AM, Timur Tabi wrote: > Augment mdiobus_alloc() to take a parameter indicating the number of extra > bytes to allocate for private data. Almost all callers of mdiobus_alloc() > separately allocate a private data structure. By allowing mdiobus_alloc() > to allocate extr

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

2011-12-15 Thread Timur Tabi
Augment mdiobus_alloc() to take a parameter indicating the number of extra bytes to allocate for private data. Almost all callers of mdiobus_alloc() separately allocate a private data structure. By allowing mdiobus_alloc() to allocate extra memory, the two allocations can be merged into one. Thi