lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <201009241624.19118.arnd@arndb.de>
Date:	Fri, 24 Sep 2010 16:24:18 +0200
From:	Arnd Bergmann <arnd@...db.de>
To:	Vernon Mauery <vernux@...ibm.com>
Cc:	Randy Dunlap <rdunlap@...otime.net>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	Keith Mannthey <kmannth@...ibm.com>
Subject: Re: [RFC][Patch] IBM Real-Time "SMI Free" mode driver -v4

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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ