Commit c1743cbc authored by Anton Vorontsov's avatar Anton Vorontsov Committed by Greg Kroah-Hartman

pstore/ram_core: Get rid of prz->ecc enable/disable flag

Nowadays we can use prz->ecc_size as a flag, no need for the special
member in the prz struct.
Signed-off-by: default avatarAnton Vorontsov <anton.vorontsov@linaro.org>
Acked-by: default avatarKees Cook <keescook@chromium.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 5ca5d4e6
...@@ -114,7 +114,7 @@ static void notrace persistent_ram_update_ecc(struct persistent_ram_zone *prz, ...@@ -114,7 +114,7 @@ static void notrace persistent_ram_update_ecc(struct persistent_ram_zone *prz,
int ecc_size = prz->ecc_size; int ecc_size = prz->ecc_size;
int size = prz->ecc_block_size; int size = prz->ecc_block_size;
if (!prz->ecc) if (!prz->ecc_size)
return; return;
block = buffer->data + (start & ~(ecc_block_size - 1)); block = buffer->data + (start & ~(ecc_block_size - 1));
...@@ -133,7 +133,7 @@ static void persistent_ram_update_header_ecc(struct persistent_ram_zone *prz) ...@@ -133,7 +133,7 @@ static void persistent_ram_update_header_ecc(struct persistent_ram_zone *prz)
{ {
struct persistent_ram_buffer *buffer = prz->buffer; struct persistent_ram_buffer *buffer = prz->buffer;
if (!prz->ecc) if (!prz->ecc_size)
return; return;
persistent_ram_encode_rs8(prz, (uint8_t *)buffer, sizeof(*buffer), persistent_ram_encode_rs8(prz, (uint8_t *)buffer, sizeof(*buffer),
...@@ -146,7 +146,7 @@ static void persistent_ram_ecc_old(struct persistent_ram_zone *prz) ...@@ -146,7 +146,7 @@ static void persistent_ram_ecc_old(struct persistent_ram_zone *prz)
uint8_t *block; uint8_t *block;
uint8_t *par; uint8_t *par;
if (!prz->ecc) if (!prz->ecc_size)
return; return;
block = buffer->data; block = buffer->data;
...@@ -181,7 +181,7 @@ static int persistent_ram_init_ecc(struct persistent_ram_zone *prz, ...@@ -181,7 +181,7 @@ static int persistent_ram_init_ecc(struct persistent_ram_zone *prz,
int ecc_symsize = 8; int ecc_symsize = 8;
int ecc_poly = 0x11d; int ecc_poly = 0x11d;
if (!prz->ecc) if (!ecc_size)
return 0; return 0;
prz->ecc_block_size = 128; prz->ecc_block_size = 128;
...@@ -395,8 +395,6 @@ static int __devinit persistent_ram_post_init(struct persistent_ram_zone *prz, ...@@ -395,8 +395,6 @@ static int __devinit persistent_ram_post_init(struct persistent_ram_zone *prz,
{ {
int ret; int ret;
prz->ecc = ecc_size;
ret = persistent_ram_init_ecc(prz, ecc_size); ret = persistent_ram_init_ecc(prz, ecc_size);
if (ret) if (ret)
return ret; return ret;
......
...@@ -33,7 +33,6 @@ struct persistent_ram_zone { ...@@ -33,7 +33,6 @@ struct persistent_ram_zone {
size_t buffer_size; size_t buffer_size;
/* ECC correction */ /* ECC correction */
bool ecc;
char *par_buffer; char *par_buffer;
char *par_header; char *par_header;
struct rs_control *rs_decoder; struct rs_control *rs_decoder;
......
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