The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Leon Romanovsky <leon@leon.nu>
Cc: Samuel Ortiz <sameo@linux.intel.com>,
	sbkim73@samsung.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drivers: mfd: sec-code: Fix sizeof argument
Date: Fri, 17 May 2013 10:58:20 -0700	[thread overview]
Message-ID: <1368813500.2194.83.camel@joe-AO722> (raw)
In-Reply-To: <CALq1K=J=Aeg11H5aX8bj-_EowdADJSg5oVY98c1q0v6YbhZEdg@mail.gmail.com>

On Fri, 2013-05-17 at 20:50 +0300, Leon Romanovsky wrote:
> On Fri, May 17, 2013 at 1:13 AM, Samuel Ortiz <sameo@linux.intel.com> wrote:
> > On Wed, May 15, 2013 at 01:53:56PM +0300, Leon Romanovsky wrote:
> >> diff --git a/drivers/mfd/sec-core.c b/drivers/mfd/sec-core.c
[]
> >> @@ -121,7 +121,7 @@ static struct sec_platform_data *sec_pmic_i2c_parse_dt_pdata(
[]
> >> -     pd = devm_kzalloc(dev, sizeof(*pd), GFP_KERNEL);
> >> +     pd = devm_kzalloc(dev, sizeof(struct sec_platform_data), GFP_KERNEL);
> > How is that fixing anything ?
> Technically you are right, this fix brings code to be align to common
> code convention and allows to automatic tools  correctly parse it.

Not really.
Common coding convention is actually the original code.

from: Documentation/CodingStyle:

		Chapter 14: Allocating memory
[]
The preferred form for passing a size of a struct is the following:

	p = kmalloc(sizeof(*p), ...);



  reply	other threads:[~2013-05-17 17:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-15 10:53 [PATCH] drivers: mfd: sec-code: Fix sizeof argument Leon Romanovsky
2013-05-16 22:13 ` Samuel Ortiz
2013-05-17 17:50   ` Leon Romanovsky
2013-05-17 17:58     ` Joe Perches [this message]
2013-05-17 18:16       ` Leon Romanovsky

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=1368813500.2194.83.camel@joe-AO722 \
    --to=joe@perches.com \
    --cc=leon@leon.nu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sameo@linux.intel.com \
    --cc=sbkim73@samsung.com \
    /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