All of lore.kernel.org
 help / color / mirror / Atom feed
From: Denis Vlasenko <vda@ilport.com.ua>
To: Nikita Danilov <nikita@clusterfs.com>
Cc: Pekka J Enberg <penberg@cs.helsinki.fi>,
	Dmitry Torokhov <dtor_core@ameritech.net>,
	linux-kernel@vger.kernel.org, jirislaby@gmail.com,
	lion.vollnhals@web.de
Subject: Re: [PATCH] use kzalloc instead of malloc+memset
Date: Wed, 14 Sep 2005 08:02:59 +0300	[thread overview]
Message-ID: <200509140802.59435.vda@ilport.com.ua> (raw)
In-Reply-To: <17190.33539.992902.463545@gargle.gargle.HOWL>

On Tuesday 13 September 2005 10:42, Nikita Danilov wrote:
> Pekka J Enberg writes:
> 
> [...]
> 
>  > +
>  > +The kernel provides the following general purpose memory allocators:
>  > +kmalloc(), kzalloc(), kcalloc(), and vmalloc().  Please refer to the API
>  > +documentation for further information about them.
>  > +
>  > +The preferred form for passing a size of a struct is the following:
>  > +
>  > +	p = kmalloc(sizeof(*p), ...);
> 
> Parentheses around *p are superfluous. See
> 
>  >   The C Programming Language, Second Edition
>  >   by Brian W. Kernighan and Dennis M. Ritchie.

I remember that sizeof has two forms: sizeof(type) and
sizeof(expr), and in one of them ()'s are optional.
But I fail to remember in which one. I use ()'s always.

Thanks for refreshing my memory but I'm sure
I'll forget again ;)
--
vda

  parent reply	other threads:[~2005-09-14  5:03 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-12 22:10 [PATCH] use kzalloc instead of malloc+memset Lion Vollnhals
2005-09-12 22:47 ` Lion Vollnhals
2005-09-13  5:41   ` Denis Vlasenko
2005-09-13 11:27     ` Jiri Slaby
2005-09-12 22:58 ` Jiri Slaby
2005-09-13  4:43   ` Pekka Enberg
2005-09-13  5:33     ` Dmitry Torokhov
2005-09-13  6:42       ` Andrew Morton
2005-09-13  7:02         ` Pekka J Enberg
2005-09-13  7:42           ` Nikita Danilov
2005-09-13 16:31             ` Pekka Enberg
2005-09-14  5:02             ` Denis Vlasenko [this message]
2005-09-14  9:58               ` Nikita Danilov
2005-09-13 23:28         ` Paul Jackson
2005-09-14  9:33           ` Bernd Petrovitsch

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=200509140802.59435.vda@ilport.com.ua \
    --to=vda@ilport.com.ua \
    --cc=dtor_core@ameritech.net \
    --cc=jirislaby@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lion.vollnhals@web.de \
    --cc=nikita@clusterfs.com \
    --cc=penberg@cs.helsinki.fi \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.