From patchwork Tue Jun 19 02:15:54 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Vorontsov X-Patchwork-Id: 9419 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 09BC823F19 for ; Tue, 19 Jun 2012 02:18:24 +0000 (UTC) Received: from mail-yw0-f52.google.com (mail-yw0-f52.google.com [209.85.213.52]) by fiordland.canonical.com (Postfix) with ESMTP id B620AA18AAB for ; Tue, 19 Jun 2012 02:18:23 +0000 (UTC) Received: by yhpp61 with SMTP id p61so4788165yhp.11 for ; Mon, 18 Jun 2012 19:18:23 -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=itnDC91uFVkbahwuiOxu618P+f4NeERxbq2idIFf/SpUKhQ99x9h3m1sXUuOsy1qfO 2IM0KIqntlnj/IvnRNph84+xqPDBbE+MccALaWLpCJ5J7hwWMRGmBpjYdfda/kBO4swR Of8F9QVavK/foxM2wiuSYYZ3L50JI1DOeOl1Lg/TioqwRFiJ11BVsShonR/X05pz6xfC yZC6tJCN/gkspLTOBG1PKAT/Ys97AHxy3HVKck6GJXIGW5TE+xSqFy3XZaZ3jJ+j/qjB T4Rh4KRNWf3QUgQuyQ4E8yvlHHvuCP9Ya/HzvbASpbcHs2gtIw4I+U1e+OUGPtDwaEqg JuIg== Received: by 10.50.87.227 with SMTP id bb3mr2295492igb.57.1340072303089; Mon, 18 Jun 2012 19:18:23 -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 v20csp101058ibb; Mon, 18 Jun 2012 19:18:22 -0700 (PDT) Received: by 10.68.203.66 with SMTP id ko2mr58804603pbc.84.1340072302431; Mon, 18 Jun 2012 19:18:22 -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 qa1si9911089pbb.216.2012.06.18.19.18.22 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 18 Jun 2012 19:18:22 -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 mail-pb0-f50.google.com with SMTP id rr4so10377373pbb.37 for ; Mon, 18 Jun 2012 19:18:22 -0700 (PDT) Received: by 10.68.200.102 with SMTP id jr6mr59198253pbc.0.1340072302093; Mon, 18 Jun 2012 19:18:22 -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 hb5sm25970979pbc.58.2012.06.18.19.18.16 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 18 Jun 2012 19:18:21 -0700 (PDT) From: Anton Vorontsov To: Greg Kroah-Hartman , Kees Cook , Colin Cross , Tony Luck Cc: 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 5/7] pstore/ram_core: Get rid of prz->ecc_symsize and prz->ecc_poly Date: Mon, 18 Jun 2012 19:15:54 -0700 Message-Id: <1340072156-6225-5-git-send-email-anton.vorontsov@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <20120619021050.GA19387@lizard> References: <20120619021050.GA19387@lizard> X-Gm-Message-State: ALoCoQlUksf/zwLNIK1jbsbT1A5/fRoDahnJs5iaZ6oAG3dKlZcyPw3GmWZnEwJObJf6f2HS7sj2 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;