[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20170102095158.2394cf93@bbrezillon>
Date: Mon, 2 Jan 2017 09:51:58 +0100
From: Boris Brezillon <boris.brezillon@...e-electrons.com>
To: Arvind Yadav <arvind.yadav.cs@...il.com>
Cc: richard@....at, dwmw2@...radead.org, computersforpeace@...il.com,
marek.vasut@...il.com, cyrille.pitchen@...el.com,
linux-mtd@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH V1] mtd : nand : denali :- No need of devm functions
On Mon, 2 Jan 2017 13:26:01 +0530
Arvind Yadav <arvind.yadav.cs@...il.com> wrote:
> yes, if Memory is live out side function. Then devm_kzalloc()
> approach has the benefit of simplifying the different error paths.
>
> Here, Memory is alive with in function. we are going to free allocate memory
> then why we need devm api. In this case Devm will first add this entry to
> list and immediately it will remove from list. In this case, It's just a
> overhead
> for devm api.
Yes, it adds a small overhead, but ITOH, it simplifies the code (see
the kfree() calls you added in different error paths with your
approach). Sometime a small runtime overhead (especially when the code
is executed once at probe time) is acceptable if it improves
readability.
Powered by blists - more mailing lists