From patchwork Tue Jul 10 00:03:18 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Vorontsov X-Patchwork-Id: 9904 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 2AAA723E01 for ; Tue, 10 Jul 2012 00:06:52 +0000 (UTC) Received: from mail-gg0-f180.google.com (mail-gg0-f180.google.com [209.85.161.180]) by fiordland.canonical.com (Postfix) with ESMTP id 77DF8A18740 for ; Tue, 10 Jul 2012 00:06:51 +0000 (UTC) Received: by ggnf1 with SMTP id f1so11485458ggn.11 for ; Mon, 09 Jul 2012 17:06:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=P2AeKVm1S584dHORFKUmpLu0adogD9/DTrXb+gwv2D8=; b=XQd7r9d74kWSBbY7Z/HW0F03g5SlHColgni3oVNkvobkFnV0GzX2N4UwJUXUlLO/9H wAhqujyp5Nn0Z6jBd0fjxDHWB+191jaTiQBIJ1yI9BLwDwZH5dH8n6WB37CAoPNGrOHm kTtzSuBqaVrJZXaDjUbFe/u/cXZg+dq4/ujI00Cgjz8bWWrmm+zlR3j+mM5mzEDyzTO6 9T03pWTVIX3HrDW5RszH0hg2aQ/dAsiFCRisc4KLg52tPGCWZdS8YWQZFqjQ9sSv3iAy Ccz0/issYiyJKEJriiCRg3LFFFx/dcONfVpLtx3YxXeadfIP6bpVcntWMta9AyHnFQwf OggQ== Received: by 10.50.40.193 with SMTP id z1mr10079017igk.0.1341878810445; Mon, 09 Jul 2012 17:06:50 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.231.24.148 with SMTP id v20csp42603ibb; Mon, 9 Jul 2012 17:06:49 -0700 (PDT) Received: by 10.68.134.201 with SMTP id pm9mr65634199pbb.49.1341878808939; Mon, 09 Jul 2012 17:06:48 -0700 (PDT) Received: from mail-pb0-f50.google.com (mail-pb0-f50.google.com [209.85.160.50]) by mx.google.com with ESMTPS id hw8si58962804pbc.176.2012.07.09.17.06.48 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 09 Jul 2012 17:06:48 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.160.50 is neither permitted nor denied by best guess record for domain of anton.vorontsov@linaro.org) client-ip=209.85.160.50; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.160.50 is neither permitted nor denied by best guess record for domain of anton.vorontsov@linaro.org) smtp.mail=anton.vorontsov@linaro.org Received: by pbbrr4 with SMTP id rr4so23724080pbb.37 for ; Mon, 09 Jul 2012 17:06:48 -0700 (PDT) Received: by 10.68.138.195 with SMTP id qs3mr65154608pbb.15.1341878808424; Mon, 09 Jul 2012 17:06:48 -0700 (PDT) Received: from localhost (c-71-204-165-222.hsd1.ca.comcast.net. [71.204.165.222]) by mx.google.com with ESMTPS id to1sm28659365pbc.27.2012.07.09.17.06.46 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 09 Jul 2012 17:06:47 -0700 (PDT) From: Anton Vorontsov To: Greg Kroah-Hartman , Kees Cook , Colin Cross , Tony Luck Cc: Dan Carpenter , Arnd Bergmann , John Stultz , Shuah Khan , arve@android.com, Rebecca Schultz Zavin , Jesper Juhl , Randy Dunlap , Stephen Boyd , Thomas Meyer , Andrew Morton , Marco Stornelli , WANG Cong , 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 Message-Id: <1341878600-2139-1-git-send-email-anton.vorontsov@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <20120709234559.GA22203@lizard> References: <20120709234559.GA22203@lizard> X-Gm-Message-State: ALoCoQlo1uQaFUZ2/7DKe4twYFBgYARZQ9SGntfk/fnrEJWFcCS70Lnbk4pEtqpnPF7sa0NBpFbH 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 --- 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;