Commit 3faf9354 authored by Bhumika Goyal's avatar Bhumika Goyal Committed by Kees Cook

pstore: constify pstore_zbackend structures

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: default avatarBhumika Goyal <bhumirks@gmail.com>
Signed-off-by: default avatarKees Cook <keescook@chromium.org>
parent c1ae3cfa
...@@ -267,7 +267,7 @@ static void free_zlib(void) ...@@ -267,7 +267,7 @@ static void free_zlib(void)
big_oops_buf_sz = 0; big_oops_buf_sz = 0;
} }
static struct pstore_zbackend backend_zlib = { static const struct pstore_zbackend backend_zlib = {
.compress = compress_zlib, .compress = compress_zlib,
.decompress = decompress_zlib, .decompress = decompress_zlib,
.allocate = allocate_zlib, .allocate = allocate_zlib,
...@@ -328,7 +328,7 @@ static void free_lzo(void) ...@@ -328,7 +328,7 @@ static void free_lzo(void)
big_oops_buf_sz = 0; big_oops_buf_sz = 0;
} }
static struct pstore_zbackend backend_lzo = { static const struct pstore_zbackend backend_lzo = {
.compress = compress_lzo, .compress = compress_lzo,
.decompress = decompress_lzo, .decompress = decompress_lzo,
.allocate = allocate_lzo, .allocate = allocate_lzo,
...@@ -393,7 +393,7 @@ static void free_lz4(void) ...@@ -393,7 +393,7 @@ static void free_lz4(void)
big_oops_buf_sz = 0; big_oops_buf_sz = 0;
} }
static struct pstore_zbackend backend_lz4 = { static const struct pstore_zbackend backend_lz4 = {
.compress = compress_lz4, .compress = compress_lz4,
.decompress = decompress_lz4, .decompress = decompress_lz4,
.allocate = allocate_lz4, .allocate = allocate_lz4,
...@@ -402,7 +402,7 @@ static struct pstore_zbackend backend_lz4 = { ...@@ -402,7 +402,7 @@ static struct pstore_zbackend backend_lz4 = {
}; };
#endif #endif
static struct pstore_zbackend *zbackend = static const struct pstore_zbackend *zbackend =
#if defined(CONFIG_PSTORE_ZLIB_COMPRESS) #if defined(CONFIG_PSTORE_ZLIB_COMPRESS)
&backend_zlib; &backend_zlib;
#elif defined(CONFIG_PSTORE_LZO_COMPRESS) #elif defined(CONFIG_PSTORE_LZO_COMPRESS)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment