Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp1098094ybe; Fri, 6 Sep 2019 11:49:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqx4X0IsYsm3soKlZzLXsQqRbFLCVsbiEKsLf61Rh2PbapO99yYWyIvA4n7+RShAJEsRpzcV X-Received: by 2002:a17:90a:f993:: with SMTP id cq19mr11478704pjb.51.1567795781268; Fri, 06 Sep 2019 11:49:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567795781; cv=none; d=google.com; s=arc-20160816; b=THKFwzH0Ek71pNspu/ujoK6vzzdhm9cBKe3oRcse8hbeZSlJxUiQ0zwM9V35WkW7aB l7MfCvKPLn1f3uCuulor96h6xLma1nM1WpgDy5Yjzyt/kdbdGXd59Bbc7tj+y14f8C5/ GKX6zqDSiOVcW4pJlhn9McYwKJqCv10SYVPLyXJ/WGbPLjISOLE8sK7cSDdISLGIzYH3 W8rY26Z1WO5NE/0klG/votnO1j/BOWPgKYUOs4APfD6CE2JnBnKI4kC6q4xLlt/wpTJo Ne3F8UfcJRcaIiK6xIs1Y9Ppd3mmeaWhgk/+blN7VHdpVt5N+1UUYFvo2PRQ6p9kCBNo 1jOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=sbLcBrROmPrOFCvrSfUG6iO92+BsnIizZdBn0J6rmy8=; b=wU9AW9P7SYNM0avKaFUT2F8lmQ1goluXY1dO0OZAN7WSBR2udSxkALph0OyFNiq0pB Rrtwxr8JuZfPsc8jIfZ3sTXR2EnsYKlqp2CnwIR30p4hB+zD6CJRPe+fc7GfV+1m95Xb 7Z4DlEDd9S29hYCzyaZefUFv6Mj6qznsa6iuZu1/RRIl/lV9Xt7O2gqBnNdEZzEeAliD cu4My+LqSZP83YO9IojDgonDa1BzwP948dobnHSM+qvacrvIa1+/1cnQBKDuXC04VMsA FN5MBTE3Ljc6BcLj5mOIK39RoLW+1rEJCpUxaViijoOUk1XkIHypg67LVF+3LO794DvL SyTA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x7si5685045pff.140.2019.09.06.11.49.25; Fri, 06 Sep 2019 11:49:41 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391852AbfIFNiR (ORCPT + 99 others); Fri, 6 Sep 2019 09:38:17 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:43751 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389779AbfIFNiR (ORCPT ); Fri, 6 Sep 2019 09:38:17 -0400 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 1i6ERI-000166-RF; Fri, 06 Sep 2019 13:38:12 +0000 From: Colin King To: Eric Van Hensbergen , Latchesar Ionkov , Dominique Martinet , v9fs-developer@lists.sourceforge.net Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] 9p: make two arrays static const, makes object smaller Date: Fri, 6 Sep 2019 14:38:12 +0100 Message-Id: <20190906133812.17196-1-colin.king@canonical.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Colin Ian King Don't populate the arrays on the stack but instead make them static const. Makes the object code smaller by 386 bytes. Before: text data bss dec hex filename 17443 2076 0 19519 4c3f fs/9p/vfs_inode_dotl.o After: text data bss dec hex filename 16897 2236 0 19133 4abd fs/9p/vfs_inode_dotl.o (gcc version 9.2.1, amd64) Signed-off-by: Colin Ian King --- fs/9p/vfs_inode_dotl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/9p/vfs_inode_dotl.c b/fs/9p/vfs_inode_dotl.c index 60328b21c5fb..961d8d0fa905 100644 --- a/fs/9p/vfs_inode_dotl.c +++ b/fs/9p/vfs_inode_dotl.c @@ -167,7 +167,7 @@ static int v9fs_mapped_dotl_flags(int flags) { int i; int rflags = 0; - struct dotl_openflag_map dotl_oflag_map[] = { + static const struct dotl_openflag_map dotl_oflag_map[] = { { O_CREAT, P9_DOTL_CREATE }, { O_EXCL, P9_DOTL_EXCL }, { O_NOCTTY, P9_DOTL_NOCTTY }, @@ -512,7 +512,7 @@ static int v9fs_mapped_iattr_valid(int iattr_valid) { int i; int p9_iattr_valid = 0; - struct dotl_iattr_map dotl_iattr_map[] = { + static const struct dotl_iattr_map dotl_iattr_map[] = { { ATTR_MODE, P9_ATTR_MODE }, { ATTR_UID, P9_ATTR_UID }, { ATTR_GID, P9_ATTR_GID }, -- 2.20.1