public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Javi Merino <javi.merino@arm.com>
Cc: Eduardo Valentin <edubezval@gmail.com>,
	Zhang Rui <rui.zhang@intel.com>,
	Lukasz Majewski <l.majewski@samsung.com>,
	Peter Feuerer <peter@piie.net>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Punit Agrawal <Punit.Agrawal@arm.com>,
	"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] thermal: power_allocator: do not use devm* interfaces
Date: Wed, 5 Aug 2015 09:50:20 -0700	[thread overview]
Message-ID: <20150805165020.GB3603@dtor-ws> (raw)
In-Reply-To: <20150805082910.GB2688@e104805>

On Wed, Aug 05, 2015 at 09:29:11AM +0100, Javi Merino wrote:
> On Tue, Aug 04, 2015 at 05:33:40PM +0100, Dmitry Torokhov wrote:
> > The code in question is called outside of standard driver
> > probe()/remove() callbacks and thus will not benefit from use of devm*
> > infrastructure.
> > 
> > Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> 
> We added the devm* calls because Eduardo asked for them in the review.
> I don't have a strong opinion regarding this, I'll leave the decision
> to Eduardo.

I tried to look for his reasons, if any, but even in earliest posted
versions use devm* for allocating memory

I guess this is one of examples of devm* usage in wrong context. Given
that you, as you have to, because this is not a device driver, manually
freeing that memory with devm_kfree(), the only thing that devm_kzalloc
and friends buy you here is extra memory allocations for devres
structures and few extra cycles for maintaining them.

Thanks.

-- 
Dmitry

  reply	other threads:[~2015-08-05 16:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-04 16:33 [PATCH] thermal: power_allocator: do not use devm* interfaces Dmitry Torokhov
2015-08-05  8:29 ` Javi Merino
2015-08-05 16:50   ` Dmitry Torokhov [this message]
2015-08-05 17:29     ` Javi Merino
2015-08-05 18:44       ` Eduardo Valentin

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=20150805165020.GB3603@dtor-ws \
    --to=dmitry.torokhov@gmail.com \
    --cc=Punit.Agrawal@arm.com \
    --cc=edubezval@gmail.com \
    --cc=javi.merino@arm.com \
    --cc=l.majewski@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=peter@piie.net \
    --cc=rui.zhang@intel.com \
    --cc=s.hauer@pengutronix.de \
    /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