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: [email protected] Bonn, Germany Diese Nachricht besteht zu 100% aus wiederverwerteten Bits. Ungeöffnet mindestens haltbar bis: (siehe Rückseite)
Attachment:
signature.asc
Description: OpenPGP digital signature
- References:
- [PATCH] some kmalloc/memset ->kzalloc (tree wide)
- From: Yoann Padioleau <[email protected]>
- Re: [PATCH] some kmalloc/memset ->kzalloc (tree wide)
- From: Tilman Schmidt <[email protected]>
- Re: [PATCH] some kmalloc/memset ->kzalloc (tree wide)
- From: yoann padioleau <[email protected]>
- [PATCH] some kmalloc/memset ->kzalloc (tree wide)
- Prev by Date: Re: [RFC][PATCH -mm] Freezer: Handle uninterruptible tasks
- Next by Date: Re: 2.6.22-rc7: known regressions with patches v2
- Previous by thread: Re: [PATCH] some kmalloc/memset ->kzalloc (tree wide)
- Next by thread: Re: [PATCH] some kmalloc/memset ->kzalloc (tree wide)
- Index(es):