Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1584087

[PATCH] fs/pstore: constify pstore_zbackend structures

Path csiph.com!aioe.org!bofh.it!news.nic.it!robomod
From Bhumika Goyal <bhumirks@gmail.com>
Newsgroups linux.kernel
Subject [PATCH] fs/pstore: constify pstore_zbackend structures
Date Sun, 19 Feb 2017 10:50:02 +0100
Message-ID <tcwhY-5Jr-5@gated-at.bofh.it> (permalink)
X-Original-To julia.lawall@lip6.fr, anton@enomsg.org, ccross@android.com, keescook@chromium.org, tony.luck@intel.com, linux-kernel@vger.kernel.org
Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=ltfafyIIEbONddnTji9Csb4lnIM8IKpvc9/Wppq3Rl4=; b=tHVJeP2jYa3p+M1hscAzn928wkUjJtv0+82D89Lkt/VfMf3GGi7WT2zdjlJcx7uFR4 dI5f2w+ZSfKlcX2PZRyO2OShQh06dPTiy3NjKGs/l9ZsS/e55G1BbUlK4sgPpu9CQiq7 kDjVbrE3wSGHIIxgMzMtyzuKdpMRbickXe2hP83OnIk7dWulVIsK9U0hEAeTAXS3KzqI hkmcZHQYCzM8mHsenGFPkFUhVoe6oC6tcKMOa7ns5ZoWMUKJ96t7FaYbgELxvFzzbj76 yrmRUAHKYXL7arGPbqaxDp9hFbEeHapfToDIARtgFYtb2BUBAMiBSQxLCIPkx2W3pRqB Kcow==
X-Google-Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=ltfafyIIEbONddnTji9Csb4lnIM8IKpvc9/Wppq3Rl4=; b=Dx4q518LDw5pZyzBXF89p7QWYmj0DsCcYDkuQaSYKsWgjgteDq2pger+hpwEh8m2v0 FzH8m3PU1kAg2jOMAVnzeok7WnxwHhQKOOEfTd67BXeIPoaVCrLjR0hCSzFPLKQjwxdU zJSJqXWm85SLSI79VKL1/lzwIUd/mpDpTHkP9whGooGyCQgk3IaeEPDAetHyeByilQOS mHujFo5yDlE4L96rUGePrCp18xtKrwm4imo7kUEDf2nHUkfSnY7zz2MuF776QwPzFIFX UpdpQH3BQbCNYN5Fi962ifMgHl006JAnO7PJB6ZTMF6TpycJLsB/s7EO0DxzOA29Z3U6 O8SA==
X-Gm-Message-State AMke39nAucyUv+Ik5OPB2PK4ij0jd7TYdBhAJGXteMGJbyrrQLTRk5FGL965cDxbwRD0Jg==
X-Received by 10.98.95.70 with SMTP id t67mr19062596pfb.37.1487497090437; Sun, 19 Feb 2017 01:38:10 -0800 (PST)
X-Mailer git-send-email 1.9.1
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 61
Organization linux.* mail to news gateway
X-Original-Cc Bhumika Goyal <bhumirks@gmail.com>
X-Original-Date Sun, 19 Feb 2017 15:07:53 +0530
X-Original-Message-ID <1487497073-26055-1-git-send-email-bhumirks@gmail.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1584087

Show key headers only | View raw


The references of pstore_zbackend structures are stored into the
pointer zbackend of type struct pstore_zbackend. The pointer zbackend
can be made const as it is only dereferenced. After making this change
the pstore_zbackend structures whose references are stored into the
pointer zbackend can be made const too.

File size before:
   text	   data	    bss	    dec	    hex	filename
   4817	    541	    172	   5530	   159a	fs/pstore/platform.o

File size after:
   text	   data	    bss	    dec	    hex	filename
   4865	    477	    172	   5514	   158a	fs/pstore/platform.o

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
---
 fs/pstore/platform.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/fs/pstore/platform.c b/fs/pstore/platform.c
index 729677e..92e8728 100644
--- a/fs/pstore/platform.c
+++ b/fs/pstore/platform.c
@@ -267,7 +267,7 @@ static void free_zlib(void)
 	big_oops_buf_sz = 0;
 }
 
-static struct pstore_zbackend backend_zlib = {
+static const struct pstore_zbackend backend_zlib = {
 	.compress	= compress_zlib,
 	.decompress	= decompress_zlib,
 	.allocate	= allocate_zlib,
@@ -328,7 +328,7 @@ static void free_lzo(void)
 	big_oops_buf_sz = 0;
 }
 
-static struct pstore_zbackend backend_lzo = {
+static const struct pstore_zbackend backend_lzo = {
 	.compress	= compress_lzo,
 	.decompress	= decompress_lzo,
 	.allocate	= allocate_lzo,
@@ -389,7 +389,7 @@ static void free_lz4(void)
 	big_oops_buf_sz = 0;
 }
 
-static struct pstore_zbackend backend_lz4 = {
+static const struct pstore_zbackend backend_lz4 = {
 	.compress	= compress_lz4,
 	.decompress	= decompress_lz4,
 	.allocate	= allocate_lz4,
@@ -398,7 +398,7 @@ static void free_lz4(void)
 };
 #endif
 
-static struct pstore_zbackend *zbackend =
+static const struct pstore_zbackend *zbackend =
 #if defined(CONFIG_PSTORE_ZLIB_COMPRESS)
 	&backend_zlib;
 #elif defined(CONFIG_PSTORE_LZO_COMPRESS)
-- 
1.9.1

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[PATCH] fs/pstore: constify pstore_zbackend structures Bhumika Goyal <bhumirks@gmail.com> - 2017-02-19 10:50 +0100

csiph-web