Linux-mm Archive on
 help / color / Atom feed
Subject: [patch 150/158] mm/shmem.c: make array 'values' static const, makes object smaller
Date: Sat, 30 Nov 2019 17:58:04 -0800
Message-ID: <> (raw)

From: Colin Ian King <>
Subject: mm/shmem.c: make array 'values' static const, makes object smaller

Don't populate the array 'values' on the stack but instead make it static
const.  Makes the object code smaller by 111 bytes.

   text	   data	    bss	    dec	    hex	filename
 108612	  11169	    512	 120293	  1d5e5	mm/shmem.o

   text	   data	    bss	    dec	    hex	filename
 108437	  11233	    512	 120182	  1d576	mm/shmem.o

(gcc version 9.2.1, amd64)

Signed-off-by: Colin Ian King <>
Reviewed-by: Andrew Morton <>
Cc: Hugh Dickins <>
Signed-off-by: Andrew Morton <>

 mm/shmem.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/mm/shmem.c~mm-shmemc-make-array-values-static-const-makes-object-smaller
+++ a/mm/shmem.c
@@ -3932,7 +3932,7 @@ out2:
 static ssize_t shmem_enabled_show(struct kobject *kobj,
 		struct kobj_attribute *attr, char *buf)
-	int values[] = {
+	static const int values[] = {

                 reply index

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publically 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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux-mm Archive on

Archives are clonable:
	git clone --mirror linux-mm/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-mm linux-mm/ \
	public-inbox-index linux-mm

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone