diff options
author | Anton Vorontsov <anton.vorontsov@linaro.org> | 2012-07-09 20:03:18 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-07-17 12:46:52 -0400 |
commit | 4a53ffae6afc94bab803087245b3b45e712c21c8 (patch) | |
tree | ac8ef7567e1ac5c043f1cabddeae9ccaf3107694 /fs/pstore | |
parent | d761074bfa05c763353c265aea3e8781f733a03e (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>
Diffstat (limited to 'fs/pstore')
-rw-r--r-- | fs/pstore/ram_core.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/fs/pstore/ram_core.c b/fs/pstore/ram_core.c index a5a7b13d358c..3f4d6e64f6d7 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) | |||
177 | struct persistent_ram_buffer *buffer = prz->buffer; | 177 | struct persistent_ram_buffer *buffer = prz->buffer; |
178 | int ecc_blocks; | 178 | int ecc_blocks; |
179 | size_t ecc_total; | 179 | size_t ecc_total; |
180 | int ecc_symsize = 8; | ||
181 | int ecc_poly = 0x11d; | ||
180 | 182 | ||
181 | if (!prz->ecc) | 183 | if (!prz->ecc) |
182 | return 0; | 184 | return 0; |
183 | 185 | ||
184 | prz->ecc_block_size = 128; | 186 | prz->ecc_block_size = 128; |
185 | prz->ecc_size = 16; | 187 | prz->ecc_size = 16; |
186 | prz->ecc_symsize = 8; | ||
187 | prz->ecc_poly = 0x11d; | ||
188 | 188 | ||
189 | ecc_blocks = DIV_ROUND_UP(prz->buffer_size, prz->ecc_block_size); | 189 | ecc_blocks = DIV_ROUND_UP(prz->buffer_size, prz->ecc_block_size); |
190 | ecc_total = (ecc_blocks + 1) * prz->ecc_size; | 190 | ecc_total = (ecc_blocks + 1) * prz->ecc_size; |
@@ -202,8 +202,7 @@ static int persistent_ram_init_ecc(struct persistent_ram_zone *prz) | |||
202 | * first consecutive root is 0 | 202 | * first consecutive root is 0 |
203 | * primitive element to generate roots = 1 | 203 | * primitive element to generate roots = 1 |
204 | */ | 204 | */ |
205 | prz->rs_decoder = init_rs(prz->ecc_symsize, prz->ecc_poly, 0, 1, | 205 | prz->rs_decoder = init_rs(ecc_symsize, ecc_poly, 0, 1, prz->ecc_size); |
206 | prz->ecc_size); | ||
207 | if (prz->rs_decoder == NULL) { | 206 | if (prz->rs_decoder == NULL) { |
208 | pr_info("persistent_ram: init_rs failed\n"); | 207 | pr_info("persistent_ram: init_rs failed\n"); |
209 | return -EINVAL; | 208 | return -EINVAL; |