public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Tilman Schmidt <tilman@imap.cc>
To: yoann padioleau <padator@wanadoo.fr>
Cc: kernel-janitors@lists.osdl.org, akpm@linux-foundation.org,
	linux-kernel@vger.kernel.org, Julia Lawall <julia@diku.dk>
Subject: Re: [PATCH] some kmalloc/memset ->kzalloc (tree wide)
Date: Sun, 08 Jul 2007 01:06:54 +0200	[thread overview]
Message-ID: <46901C8E.5050103@imap.cc> (raw)
In-Reply-To: <0BE121C2-D115-4A9A-A557-E65F0F8CBA26@wanadoo.fr>

[-- Attachment #1: Type: text/plain, Size: 1254 bytes --]

Am 07.07.2007 15:36 schrieb yoann padioleau:
> On 7 juil. 07, at 15:07, Tilman Schmidt wrote:
> 
>> This misses the semantic distinction between the first and second
>> arguments of kcalloc(). The first argument is supposed to be the
>> number of elements to allocate and the second their size. As a
>> consequence, the following hunks in your pathc are wrong:
> 
> Yes you are right. Andrew Morton fixed the problem in a
> subsequent patch.

That's ok then. Andrew is doing an awesome job.

> I should have written a more precise semantic patch such as
> 
> @@
> expression E;
> constant c;
> type T;
> @@
> 
> - kzalloc(sizeof(T) * c, E)
> + kcalloc(c, sizeof(T), E)
> 
> Note that sometimes the code is written as  kzalloc(c * sizeof(T), E)
> as in   kzalloc(2 * sizeof(struct resource), GFP_KERNEL)  but
> our transformation engine can handle the commutativity of '*' and still
> performs the right transformation.

Cool. That transformation engine sure sounds like an interesting
piece of code.

Regards,
Tilman

-- 
Tilman Schmidt                          E-Mail: tilman@imap.cc
Bonn, Germany
Diese Nachricht besteht zu 100% aus wiederverwerteten Bits.
Ungeöffnet mindestens haltbar bis: (siehe Rückseite)


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 253 bytes --]

  reply	other threads:[~2007-07-07 23:02 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-06 16:51 [PATCH] some kmalloc/memset ->kzalloc (tree wide) Yoann Padioleau
2007-07-06 17:04 ` Peter Zijlstra
2007-07-06 17:54   ` Christoph Lameter
2007-07-06 17:55 ` Heikki Orsila
2007-07-06 22:07   ` James Morris
2007-07-06 23:16     ` Andrew Morton
2007-07-07 13:07 ` Tilman Schmidt
2007-07-07 13:36   ` yoann padioleau
2007-07-07 23:06     ` Tilman Schmidt [this message]
2007-07-07 18:42 ` Jan Engelhardt
2007-07-08 19:45 ` Luca Tettamanti

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=46901C8E.5050103@imap.cc \
    --to=tilman@imap.cc \
    --cc=akpm@linux-foundation.org \
    --cc=julia@diku.dk \
    --cc=kernel-janitors@lists.osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=padator@wanadoo.fr \
    /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