summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Vorontsov <anton.vorontsov@linaro.org>2012-07-09 17:03:18 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-07-17 09:46:52 -0700
commit4a53ffae6afc94bab803087245b3b45e712c21c8 (patch)
treeac8ef7567e1ac5c043f1cabddeae9ccaf3107694
parentd761074bfa05c763353c265aea3e8781f733a03e (diff)
pstore/ram_core: Get rid of prz->ecc_symsize and prz->ecc_poly
The struct members were never used anywhere outside of persistent_ram_init_ecc(), so there's actually no need for them to be in the struct. If we ever want to make polynomial or symbol size configurable, it would make more sense to just pass initialized rs_decoder to the persistent_ram init functions. Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org> Acked-by: Kees Cook <keescook@chromium.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--fs/pstore/ram_core.c7
-rw-r--r--include/linux/pstore_ram.h2
2 files changed, 3 insertions, 6 deletions
diff --git a/fs/pstore/ram_core.c b/fs/pstore/ram_core.c
index a5a7b13d358..3f4d6e64f6d 100644
--- a/fs/pstore/ram_core.c
+++ b/fs/pstore/ram_core.c
@@ -177,14 +177,14 @@ static int persistent_ram_init_ecc(struct persistent_ram_zone *prz)
struct persistent_ram_buffer *buffer = prz->buffer;
int ecc_blocks;
size_t ecc_total;
+ int ecc_symsize = 8;
+ int ecc_poly = 0x11d;
if (!prz->ecc)
return 0;
prz->ecc_block_size = 128;
prz->ecc_size = 16;
- prz->ecc_symsize = 8;
- prz->ecc_poly = 0x11d;
ecc_blocks = DIV_ROUND_UP(prz->buffer_size, prz->ecc_block_size);
ecc_total = (ecc_blocks + 1) * prz->ecc_size;
@@ -202,8 +202,7 @@ static int persistent_ram_init_ecc(struct persistent_ram_zone *prz)
* first consecutive root is 0
* primitive element to generate roots = 1
*/
- prz->rs_decoder = init_rs(prz->ecc_symsize, prz->ecc_poly, 0, 1,
- prz->ecc_size);
+ prz->rs_decoder = init_rs(ecc_symsize, ecc_poly, 0, 1, prz->ecc_size);
if (prz->rs_decoder == NULL) {
pr_info("persistent_ram: init_rs failed\n");
return -EINVAL;
diff --git a/include/linux/pstore_ram.h b/include/linux/pstore_ram.h
index e681af92c04..a0975c02194 100644
--- a/include/linux/pstore_ram.h
+++ b/include/linux/pstore_ram.h
@@ -41,8 +41,6 @@ struct persistent_ram_zone {
int bad_blocks;
int ecc_block_size;
int ecc_size;
- int ecc_symsize;
- int ecc_poly;
char *old_log;
size_t old_log_size;