ocfs2-devel.oss.oracle.com archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Wengang <wen.gang.wang@oracle.com>
Cc: Fabian Frederick <fabf@skynet.be>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	ocfs2-devel@oss.oracle.com
Subject: [Ocfs2-devel] [PATCH 1/1] OCFS2: Remove NULL assignments on static
Date: Wed, 9 Apr 2014 13:44:48 -0700	[thread overview]
Message-ID: <20140409134448.cb23b34622bf986d145f1eaa@linux-foundation.org> (raw)
In-Reply-To: <534499FA.8010107@oracle.com>

On Wed, 09 Apr 2014 08:53:14 +0800 Wengang <wen.gang.wang@oracle.com> wrote:

> ___ 2014___04___09___ 04:13, Fabian Frederick ______:
> > static values are automatically initialized to NULL.
> >
>
> What's the badness if we do the assignments?

(top-posting repaired...)

Back in the olden days,

	static int x = 0;

would consume space in the .data segment and

	static int x;

would consume space in the .bss segment.


The .data segment is a part of vmlinux (because it contains non-zero
data) whereas .bss does not occupy space in vmlinux because .bss is
all-zero and can be built at runtime

So the effect of this patch would be to reduce the size of the kernel
image.  Less disk space, less ROM space, etc.


I think more recent gcc's and linkers got smarter about that and move
initialized-to-zero .data into .bss anyway.

      parent reply	other threads:[~2014-04-09 20:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-08 20:13 [Ocfs2-devel] [PATCH 1/1] OCFS2: Remove NULL assignments on static Fabian Frederick
2014-04-09  0:53 ` Wengang
2014-04-09  4:22   ` Fabian Frederick
2014-04-09 20:44   ` Andrew Morton [this message]

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=20140409134448.cb23b34622bf986d145f1eaa@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=fabf@skynet.be \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ocfs2-devel@oss.oracle.com \
    --cc=wen.gang.wang@oracle.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).