mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Russell King <rmk+lkml@arm.linux.org.uk>
To: domen@coderock.org, Al Viro <viro@zenII.uk.linux.org>
Cc: linux-kernel@vger.kernel.org, Christophe Lucas <clucas@rotomalug.org>
Subject: Re: [patch 1/1] sizeof(*dev) : arch/arm/common/sa1111.c
Date: Fri, 1 Jul 2005 11:04:03 +0100	[thread overview]
Message-ID: <20050701110403.A13198@flint.arm.linux.org.uk> (raw)
In-Reply-To: <20050630215819.226570000@>; from domen@coderock.org on Thu, Jun 30, 2005 at 11:58:19PM +0200

On Thu, Jun 30, 2005 at 11:58:19PM +0200, domen@coderock.org wrote:
> when using sizeof consider using the variable and not the type, that way
> if the type of the variable is changed we don't have to go seaching
> all instances of sizeof(type).

This is a matter of taste, and I decided upon sizeof(type) after a
discussion with Al Viro on this subject.

I believe the overwealming argument for sizeof(type) as opposed to
sizeof(expression) is that you can identify easily where likely
initialisations happen, and therefore places which need to be
properly updated if/when you change the type.

I'm also sending this to Al so he can give his point of view on
sizeof(type) vs sizeof(expression).

-- 
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:  2.6 Serial core

           reply	other threads:[~2005-07-01 10:04 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <20050630215819.226570000@>]

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=20050701110403.A13198@flint.arm.linux.org.uk \
    --to=rmk+lkml@arm.linux.org.uk \
    --cc=clucas@rotomalug.org \
    --cc=domen@coderock.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@zenII.uk.linux.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®