[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1495708535.29207.1.camel@perches.com>
Date: Thu, 25 May 2017 03:35:35 -0700
From: Joe Perches <joe@...ches.com>
To: Alexey Dobriyan <adobriyan@...il.com>,
Andrew Morton <akpm@...ux-foundation.org>
Cc: Linux Kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] CodingStyle: delete "kmalloc(sizeof(*var))" as
preferred allocation form
On Wed, 2017-05-24 at 13:18 +0300, Alexey Dobriyan wrote:
> Proper fix is to introduce typed allocation macros with the following
> signatures:
>
> T* lmalloc(T, gfp);
[]
> struct foo *x;
> x = lmalloc(struct foo, GFP_KERNEL);
Then code would be written
x = lmalloc(typeof(*x), GFP_KERNEL);
Powered by blists - more mailing lists