From: Wolfram Sang <wsa@the-dreams.de>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Thierry Reding <thierry.reding@avionic-design.de>
Subject: Re: [PATCH] pwm: devm: alloc correct pointer size
Date: Mon, 10 Jun 2013 02:04:47 +0200 [thread overview]
Message-ID: <20130610000446.GA2928@katana> (raw)
In-Reply-To: <CAHp75Vcvhz892D4gytneptB4wLWPjfKmf5OXgnChXw338nLBAA@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 711 bytes --]
On Thu, Jun 06, 2013 at 10:43:41PM +0300, Andy Shevchenko wrote:
> On Mon, Jun 3, 2013 at 11:27 PM, Wolfram Sang <wsa@the-dreams.de> wrote:
> > The allocated object should be the size of what the pointer is pointing
> > to and not the size of the pointer itself.
>
> All devm_* functions in this module use **ptr as a parameter (except
> allocation).
> May be we first should understand why it so?
Huh? **ptr is already created on the stack, but assigned the alloced
memory. Later, the mem it points to is set to 'pwm' which is then added
to devres. So, the alloced memory must be able to contain '*ptr' (or
*pwm which would be more readable IMO, but other subsystems also stick
to *ptr), no?
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
next prev parent reply other threads:[~2013-06-10 0:02 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-03 20:27 [PATCH] pwm: devm: alloc correct pointer size Wolfram Sang
2013-06-06 19:43 ` Andy Shevchenko
2013-06-10 0:04 ` Wolfram Sang [this message]
2013-06-10 6:41 ` Andy Shevchenko
2013-06-10 10:51 ` Thierry Reding
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=20130610000446.GA2928@katana \
--to=wsa@the-dreams.de \
--cc=andy.shevchenko@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=thierry.reding@avionic-design.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