Re: [RFC PATCH 4/8] misc: emif: add basic infrastructure for EMIFdriver

From: Aneesh V
Date: Fri Feb 17 2012 - 10:27:19 EST


On Friday 17 February 2012 07:14 PM, Cousson, Benoit wrote:
Hi Aneesh,

[...]

+ emif = kzalloc(sizeof(struct emif_data), GFP_KERNEL);

You should use the devm_* version of this API to get the simplify the
error handling / removal.

Please note that most of my allocations are happening through
kmemdup(). kmemdup() doesn't have a devm_* equivalent. So, I have a
cleanup() function and in the interest of uniformity decided to avoid
devm_* variants altogether.

I think it still worth using devm_kzalloc + memcopy here instead of
kmemdup to avoid the cleanup() and simplify as well the error handling.

I will do that.


You might even propose a new devm_kmemdup API if you want.

Ok. I will attempt that, maybe both devm_kmalloc() and devm_kmemdup().
But I would like to de-couple that from this series. That is, I will do
the patch separately and if that gets up-streamed I will update EMIF
driver to use them. Until then I will go with what you suggested above.

br,
Aneesh
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/