public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Vernon Mauery <vernux@us.ibm.com>
Cc: Randy Dunlap <rdunlap@xenotime.net>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Keith Mannthey <kmannth@us.ibm.com>
Subject: Re: [RFC][Patch] IBM Real-Time "SMI Free" mode driver -v4
Date: Fri, 24 Sep 2010 16:24:18 +0200	[thread overview]
Message-ID: <201009241624.19118.arnd@arndb.de> (raw)
In-Reply-To: <AANLkTimMWAk22gSn2cXA25VNJ1o3OX-mazJfFFd_+MH2@mail.gmail.com>

On Friday 24 September 2010, Vernon Mauery wrote:
> >> +static DEFINE_MUTEX(rtl_lock);
> >> +static struct ibm_rtl_table __iomem *rtl_table = NULL;
> >> +static void __iomem *ebda_map;
> >> +static void __iomem *rtl_cmd_iomem_addr = NULL;
> >> +static u32 rtl_cmd_port_addr;
> >> +static enum rtl_addr_type rtl_cmd_type;
> >> +static u8 rtl_cmd_width;
> >
> > This is somewhat inconsistent, some of these are implicitly initialized,
> > others have an explicit "= NULL". I would recommend leaving out the
> > initialization, which is the historic way to do this in the kernel.
> 
> The variables that have an explicit initialization are the variables
> that I read before I write.  It just looks funny to me to read a
> variable that hasn't been initialized.  But I can axe the
> initializations for the sake of consistency.

Ok. Global variables are by definition initialized to zero.
Old gcc versions used to allocate space in the .data section
if you had explicit = NULL statements while they would end
up in .bss otherwise, resulting in a smaller binary image.

With newer gcc versions, it doesn't make a difference, but
many people have the "don't initialize globals to zero" meme
hardcoded to their brains now ;-)

	Arnd

  reply	other threads:[~2010-09-24 14:24 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-21 22:46 [RFC][Patch] IBM Real-Time "SMI Free" mode driver -v3 Vernon Mauery
2010-09-23 21:38 ` Randy Dunlap
2010-09-23 22:12   ` Vernon Mauery
2010-09-23 22:53     ` [RFC][Patch] IBM Real-Time "SMI Free" mode driver -v4 Vernon Mauery
2010-09-24 13:12       ` Arnd Bergmann
2010-09-24 14:14         ` Vernon Mauery
2010-09-24 14:24           ` Arnd Bergmann [this message]
2010-09-24 16:56           ` Randy Dunlap
2010-09-24 21:06             ` [RFC][Patch] IBM Real-Time "SMI Free" mode driver -v5 Vernon Mauery
2010-09-24 21:20               ` Randy Dunlap
2010-09-24 21:30                 ` Vernon Mauery
2010-09-24 21:35                   ` Randy Dunlap
2010-09-24 21:58                     ` [RFC][Patch] IBM Real-Time "SMI Free" mode driver -v6 Vernon Mauery
2010-09-25  2:07                   ` [RFC][Patch] IBM Real-Time "SMI Free" mode driver -v5 Henrique de Moraes Holschuh
2010-09-25 14:42                     ` [RFC][Patch] IBM Real-Time "SMI Free" mode driver -v6 Vernon Mauery
2010-09-24 17:09           ` [RFC][Patch] IBM Real-Time "SMI Free" mode driver -v4 Vernon Mauery
2010-09-24 17:40             ` Arnd Bergmann
2010-09-24 18:23               ` Vernon Mauery
2010-09-24 20:40                 ` Arnd Bergmann
2010-09-24 20:45                 ` Vernon Mauery

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=201009241624.19118.arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=kmannth@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rdunlap@xenotime.net \
    --cc=vernux@us.ibm.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