From: Steve Wise <swise@opengridcomputing.com>
To: Roland Dreier <rdreier@cisco.com>
Cc: Stephen Hemminger <shemminger@osdl.org>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] iWARP Connection Manager.
Date: Wed, 31 May 2006 17:22:38 -0500 [thread overview]
Message-ID: <1149114158.7469.38.camel@stevo-desktop> (raw)
In-Reply-To: <adaverlx3ld.fsf@cisco.com>
so be it.
iwcm.c and the ammasso files will all use sizeof().
Steve.
On Wed, 2006-05-31 at 14:54 -0700, Roland Dreier wrote:
> This is a silly thing to argue about, but...
>
> > 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.
>
> I would argue that this is talking about sizeof(*p) vs. sizeof (struct foo)
> rather than sizeof(*p) vs. sizeof *p.
>
> You wouldn't write:
>
> return(*p);
>
> but rather
>
> return *p;
>
> And sizeof is an operator not a function, so I think the same usage
> would apply.
>
> With that said the prevalent kernel usage does seem to be sizeof(*foo)
> (by about 10 to 1). But I can't help feeling it looks silly.
>
> - R.
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
next prev parent reply other threads:[~2006-05-31 22:22 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-05-31 18:26 [PATCH 0/2][RFC] iWARP Core Support Steve Wise
2006-05-31 18:26 ` [PATCH 1/2] iWARP Connection Manager Steve Wise
2006-05-31 18:40 ` Stephen Hemminger
2006-05-31 19:24 ` Roland Dreier
2006-05-31 20:47 ` Muli Ben-Yehuda
2006-05-31 20:58 ` Steve Wise
2006-05-31 21:01 ` Stephen Hemminger
2006-05-31 21:54 ` Roland Dreier
2006-05-31 22:22 ` Steve Wise [this message]
2006-05-31 22:22 ` Sean Hefty
2006-06-01 17:00 ` Steve Wise
2006-06-01 21:09 ` Sean Hefty
2006-06-01 22:21 ` [openib-general] " Tom Tucker
2006-06-01 17:11 ` Tom Tucker
2006-05-31 18:26 ` [PATCH 2/2] iWARP Core Changes Steve Wise
2006-05-31 18:36 ` Stephen Hemminger
2006-05-31 19:17 ` Roland Dreier
2006-05-31 20:30 ` Steve Wise
2006-05-31 20:32 ` Roland Dreier
2006-05-31 21:26 ` Sean Hefty
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=1149114158.7469.38.camel@stevo-desktop \
--to=swise@opengridcomputing.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rdreier@cisco.com \
--cc=shemminger@osdl.org \
/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
all inboxes | Powered by JetHome®