mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Anton Vorontsov <anton.vorontsov@linaro.org>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Kees Cook <keescook@chromium.org>,
	Colin Cross <ccross@android.com>, Tony Luck <tony.luck@intel.com>
Cc: Dan Carpenter <dan.carpenter@oracle.com>,
	Arnd Bergmann <arnd@arndb.de>,
	John Stultz <john.stultz@linaro.org>,
	Shuah Khan <shuahkhan@gmail.com>,
	arve@android.com, Rebecca Schultz Zavin <rebecca@android.com>,
	Jesper Juhl <jj@chaosbits.net>,
	Randy Dunlap <rdunlap@xenotime.net>,
	Stephen Boyd <sboyd@codeaurora.org>,
	Thomas Meyer <thomas@m3y3r.de>,
	Andrew Morton <akpm@linux-foundation.org>,
	Marco Stornelli <marco.stornelli@gmail.com>,
	WANG Cong <xiyou.wangcong@gmail.com>,
	linux-kernel@vger.kernel.org, devel@driverdev.osuosl.org,
	linaro-kernel@lists.linaro.org, patches@linaro.org,
	kernel-team@android.com
Subject: [PATCH 1/3] pstore/ram_core: Get rid of prz->ecc_symsize and prz->ecc_poly
Date: Mon,  9 Jul 2012 17:03:18 -0700	[thread overview]
Message-ID: <1341878600-2139-1-git-send-email-anton.vorontsov@linaro.org> (raw)
In-Reply-To: <20120709234559.GA22203@lizard>

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>
---
 fs/pstore/ram_core.c       |    7 +++----
 include/linux/pstore_ram.h |    2 --
 2 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/fs/pstore/ram_core.c b/fs/pstore/ram_core.c
index a5a7b13..3f4d6e6 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 e681af9..a0975c0 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;
-- 
1.7.10.4


  parent reply	other threads:[~2012-07-10  0:06 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-09 23:45 [PATCH resend 0/3] pstore/ram: Configurable ECC size Anton Vorontsov
2012-07-10  0:01 ` Anton Vorontsov
2012-07-10  0:03 ` Anton Vorontsov [this message]
2012-07-10  0:03 ` [PATCH 2/3] pstore/ram: Make ECC size configurable Anton Vorontsov
2012-07-10  0:03 ` [PATCH 3/3] pstore/ram_core: Get rid of prz->ecc enable/disable flag Anton Vorontsov
2012-07-10 20:17 ` [PATCH resend 0/3] pstore/ram: Configurable ECC size Kees Cook
2012-07-11  6:28   ` Anton Vorontsov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1341878600-2139-1-git-send-email-anton.vorontsov@linaro.org \
    --to=anton.vorontsov@linaro.org \
    --cc=akpm@linux-foundation.org \
    --cc=arnd@arndb.de \
    --cc=arve@android.com \
    --cc=ccross@android.com \
    --cc=dan.carpenter@oracle.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jj@chaosbits.net \
    --cc=john.stultz@linaro.org \
    --cc=keescook@chromium.org \
    --cc=kernel-team@android.com \
    --cc=linaro-kernel@lists.linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marco.stornelli@gmail.com \
    --cc=patches@linaro.org \
    --cc=rdunlap@xenotime.net \
    --cc=rebecca@android.com \
    --cc=sboyd@codeaurora.org \
    --cc=shuahkhan@gmail.com \
    --cc=thomas@m3y3r.de \
    --cc=tony.luck@intel.com \
    --cc=xiyou.wangcong@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®