From: Boris Brezillon <boris.brezillon@free-electrons.com>
To: Arvind Yadav <arvind.yadav.cs@gmail.com>
Cc: richard@nod.at, dwmw2@infradead.org, computersforpeace@gmail.com,
marek.vasut@gmail.com, cyrille.pitchen@atmel.com,
linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH V1] mtd : nand : denali :- No need of devm functions
Date: Mon, 2 Jan 2017 09:51:58 +0100 [thread overview]
Message-ID: <20170102095158.2394cf93@bbrezillon> (raw)
In-Reply-To: <4bf4a97b-c2c3-51db-9bb1-61e6d433c7ca@gmail.com>
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.
prev parent reply other threads:[~2017-01-02 8:52 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-07 15:15 [PATCH V1] mtd : nand : denali :- No need of devm functions Arvind Yadav
2016-12-29 17:24 ` Boris Brezillon
2017-01-02 7:56 ` Arvind Yadav
2017-01-02 8:51 ` Boris Brezillon [this message]
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=20170102095158.2394cf93@bbrezillon \
--to=boris.brezillon@free-electrons.com \
--cc=arvind.yadav.cs@gmail.com \
--cc=computersforpeace@gmail.com \
--cc=cyrille.pitchen@atmel.com \
--cc=dwmw2@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=marek.vasut@gmail.com \
--cc=richard@nod.at \
/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).