[alsa-devel] [PATCH 3/3] ASoC: wm8731: Use the preferred form for passing a size of a struct
Charles Keepax
ckeepax at opensource.wolfsonmicro.com
Wed Oct 29 10:48:37 CET 2014
On Fri, Oct 24, 2014 at 01:01:27PM -0200, Fabio Estevam wrote:
> From: Fabio Estevam <fabio.estevam at freescale.com>
>
> According to Documentation/CodingStyle - Chapter 14:
>
> "The preferred form for passing a size of a struct is the following:
>
> p = kmalloc(sizeof(*p), ...);
>
> The alternative form where struct name is spelled out hurts readability and
> introduces an opportunity for a bug when the pointer variable type is changed
> but the corresponding sizeof that is passed to a memory allocator is not."
>
> So do it as recommeded.
>
> Cc: Charles Keepax <ckeepax at opensource.wolfsonmicro.com>
> Signed-off-by: Fabio Estevam <fabio.estevam at freescale.com>
> ---
Acked-by: Charles Keepax <ckeepax at opensource.wolfsonmicro.com>
Thanks,
Charles
More information about the Alsa-devel
mailing list