Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1549041
| From | Boris Brezillon <boris.brezillon@free-electrons.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH V1] mtd : nand : denali :- No need of devm functions |
| Date | 2017-01-02 10:00 +0100 |
| Message-ID | <sV6Df-4iu-23@gated-at.bofh.it> (permalink) |
| References | <sLMaL-1Ll-77@gated-at.bofh.it> <sTMGB-14H-5@gated-at.bofh.it> <sV5Hb-3CL-5@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Mon, 2 Jan 2017 13:26:01 +0530 Arvind Yadav <arvind.yadav.cs@gmail.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.
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
Re: [PATCH V1] mtd : nand : denali :- No need of devm functions Boris Brezillon <boris.brezillon@free-electrons.com> - 2016-12-29 18:30 +0100
Re: [PATCH V1] mtd : nand : denali :- No need of devm functions Arvind Yadav <arvind.yadav.cs@gmail.com> - 2017-01-02 09:00 +0100
Re: [PATCH V1] mtd : nand : denali :- No need of devm functions Boris Brezillon <boris.brezillon@free-electrons.com> - 2017-01-02 10:00 +0100
csiph-web