linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Keith Owens <kaos@ocs.com.au>
To: Matthew Wilcox <matthew@wil.cx>
Cc: Mark Maule <maule@sgi.com>,
	linux-ia64@vger.kernel.org, linux-kernel@vger.kernel.org,
	Tony Luck <tony.luck@intel.com>
Subject: Re: [PATCH 3/4] per-platform IA64_{FIRST,LAST}_DEVICE_VECTOR definitions
Date: Thu, 22 Dec 2005 17:26:12 +1100	[thread overview]
Message-ID: <8995.1135232772@kao2.melbourne.sgi.com> (raw)
In-Reply-To: Your message of "Wed, 21 Dec 2005 12:32:20 PDT." <20051221193220.GF2361@parisc-linux.org>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=us-ascii, Size: 1274 bytes --]

On Wed, 21 Dec 2005 12:32:20 -0700, 
Matthew Wilcox <matthew@wil.cx> wrote:
>On Wed, Dec 21, 2005 at 01:18:43PM -0600, Mark Maule wrote:
>> Ok.  Was just following the lead of this:
>> 
>> static struct msi_desc* msi_desc[NR_IRQS] = { [0 ... NR_IRQS-1] = NULL };
>> 
>> So arrays are always init'd to zero?
>
>Static variables without an initialiser go to the bss section and get
>initialised to 0 by the loader.  So the initialisation above is
>redundant on all machines which use a bitpattern of zeros to represent
>the NULL pointer.  Which is all machines Linux runs on.

Semi off topic nit pick.  C99 standard, section 6.7.8, note 10.

"... If an object that has static storage duration is not initialized
explicitly, then:

— if it has pointer type, it is initialized to a null pointer;
— if it has arithmetic type, it is initialized to (positive or
  unsigned) zero;
— if it is an aggregate, every member is initialized (recursively)
  according to these rules;
— if it is a union, the first named member is initialized
  (recursively) according to these rules."

On the off chance that Linux is ever implemented on a machine that does
not use zeroes for a NULL pointer, it would be the compiler's job to
correctly initialise a pointer or array of pointers.


  reply	other threads:[~2005-12-22  6:26 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-21 18:42 [PATCH 0/4] msi abstractions and support for altix Mark Maule
2005-12-21 18:42 ` [PATCH 1/4] msi archetecture init hook Mark Maule
2005-12-21 18:53   ` Matthew Wilcox
2005-12-21 19:03     ` Mark Maule
2005-12-21 19:40   ` Matthew Wilcox
2005-12-21 18:42 ` [PATCH 2/4] msi vector targeting abstractions Mark Maule
2005-12-21 18:56   ` Christoph Hellwig
2005-12-21 19:17     ` Mark Maule
2005-12-21 19:05   ` Matthew Wilcox
2005-12-21 19:17     ` linux-os (Dick Johnson)
2005-12-21 19:33     ` Mark Maule
2005-12-22 10:36       ` Christoph Hellwig
2005-12-22 13:59         ` Mark Maule
2005-12-21 18:42 ` [PATCH 3/4] per-platform IA64_{FIRST,LAST}_DEVICE_VECTOR definitions Mark Maule
2005-12-21 19:09   ` Matthew Wilcox
2005-12-21 19:18     ` Mark Maule
2005-12-21 19:32       ` Matthew Wilcox
2005-12-22  6:26         ` Keith Owens [this message]
2005-12-22 13:14           ` Matthew Wilcox
2005-12-21 18:42 ` [PATCH 4/4] altix: msi support Mark Maule

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=8995.1135232772@kao2.melbourne.sgi.com \
    --to=kaos@ocs.com.au \
    --cc=linux-ia64@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matthew@wil.cx \
    --cc=maule@sgi.com \
    --cc=tony.luck@intel.com \
    /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;
as well as URLs for NNTP newsgroup(s).