From patchwork Fri Sep 6 14:30:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin King X-Patchwork-Id: 11135373 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0AFEE924 for ; Fri, 6 Sep 2019 14:30:16 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id E273F2082C for ; Fri, 6 Sep 2019 14:30:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E273F2082C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=canonical.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 1B9866B0003; Fri, 6 Sep 2019 10:30:15 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 16A066B0006; Fri, 6 Sep 2019 10:30:15 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 07F356B0007; Fri, 6 Sep 2019 10:30:15 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0065.hostedemail.com [216.40.44.65]) by kanga.kvack.org (Postfix) with ESMTP id DB8C16B0003 for ; Fri, 6 Sep 2019 10:30:14 -0400 (EDT) Received: from smtpin20.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with SMTP id 7195F181AC9B4 for ; Fri, 6 Sep 2019 14:30:14 +0000 (UTC) X-FDA: 75904730748.20.bone42_1f25048553f3d X-Spam-Summary: 2,0,0,aa45263bd89088f9,d41d8cd98f00b204,colin.king@canonical.com,:hughd@google.com::kernel-janitors@vger.kernel.org:linux-kernel@vger.kernel.org,RULES_HIT:41:152:355:379:541:800:960:973:988:989:1260:1261:1277:1311:1313:1314:1345:1437:1515:1516:1518:1534:1540:1593:1594:1711:1730:1747:1777:1792:2393:2553:2559:2562:3138:3139:3140:3141:3142:3352:3865:3872:5007:6119:6261:7576:7903:10004:10400:11026:11473:11658:11914:12296:12297:12438:12517:12519:12555:12679:12895:12986:13069:13311:13357:13894:14181:14394:14721:21080:21433:21451:21627:30012:30054:30090,0,RBL:91.189.89.112:@canonical.com:.lbl8.mailshell.net-62.8.15.100 64.201.201.201,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:27,LUA_SUMMARY:none X-HE-Tag: bone42_1f25048553f3d X-Filterd-Recvd-Size: 1933 Received: from youngberry.canonical.com (youngberry.canonical.com [91.189.89.112]) by imf36.hostedemail.com (Postfix) with ESMTP for ; Fri, 6 Sep 2019 14:30:13 +0000 (UTC) Received: from 1.general.cking.uk.vpn ([10.172.193.212] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1i6FFc-0005RF-IG; Fri, 06 Sep 2019 14:30:12 +0000 From: Colin King To: Hugh Dickins , linux-mm@kvack.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] mm/shmem.c: make array 'values' static const, makes object smaller Date: Fri, 6 Sep 2019 15:30:12 +0100 Message-Id: <20190906143012.28698-1-colin.king@canonical.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Colin Ian King Don't populate the array 'values' on the stack but instead make it static const. Makes the object code smaller by 111 bytes. Before: text data bss dec hex filename 108612 11169 512 120293 1d5e5 mm/shmem.o After: 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 --- mm/shmem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/shmem.c b/mm/shmem.c index 77d2df011c0e..30e1de87bdca 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -3934,7 +3934,7 @@ int __init shmem_init(void) static ssize_t shmem_enabled_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf) { - int values[] = { + static const int values[] = { SHMEM_HUGE_ALWAYS, SHMEM_HUGE_WITHIN_SIZE, SHMEM_HUGE_ADVISE,