From patchwork Tue Jun 19 02:15:56 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Vorontsov X-Patchwork-Id: 9421 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 7448F23F19 for ; Tue, 19 Jun 2012 02:18:35 +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 44B40A18AA7 for ; Tue, 19 Jun 2012 02:18:35 +0000 (UTC) Received: by mail-yw0-f52.google.com with SMTP id p61so4788165yhp.11 for ; Mon, 18 Jun 2012 19:18:35 -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=uKiLgXfnVv9yoP7c1O74lDH5oFtHc2oThtkqH/7ONsY=; b=a25WM+Ut3QijZov0mqFUkM1mcN/27fGyVHzOFD9ki32J2KNefGQmKMRziJw7FIjp6B DCteGw8KP0Acf+YFWyWcRFl6pMss8y3BJJSm19eeGFdg6K59wfwhcg0MRKVt+vdihAZh p6zZUjJWqqaUhtdVFoKWSq5kE62aBrk9CsDu8059Xs+9S0GwSgf6pMRcFg1yftQHLM5/ 4OF84DEiFhk7xry4GvqdvGG3ApN0XWuGgivJQiadeqWaVoId1A6lD4JwzsmCenBSrkNP cXJTXN6ikkAGuMC8hQLQjY/v47qRgk14Iv0X7dtX3UZTkdq6FKeY5N58vG1EeTa5W3PC P0bQ== Received: by 10.50.40.193 with SMTP id z1mr7129748igk.0.1340072314838; Mon, 18 Jun 2012 19:18:34 -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 v20csp101064ibb; Mon, 18 Jun 2012 19:18:34 -0700 (PDT) Received: by 10.68.221.106 with SMTP id qd10mr59525374pbc.42.1340072314144; Mon, 18 Jun 2012 19:18:34 -0700 (PDT) Received: from mail-pz0-f50.google.com (mail-pz0-f50.google.com [209.85.210.50]) by mx.google.com with ESMTPS id wk5si15953723pbc.76.2012.06.18.19.18.33 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 18 Jun 2012 19:18:34 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.210.50 is neither permitted nor denied by best guess record for domain of anton.vorontsov@linaro.org) client-ip=209.85.210.50; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.210.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 danh15 with SMTP id h15so8728269dan.37 for ; Mon, 18 Jun 2012 19:18:33 -0700 (PDT) Received: by 10.68.222.103 with SMTP id ql7mr58419446pbc.68.1340072313822; Mon, 18 Jun 2012 19:18:33 -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 rv9sm25978523pbc.43.2012.06.18.19.18.28 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 18 Jun 2012 19:18:32 -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 7/7] pstore/ram_core: Get rid of prz->ecc enable/disable flag Date: Mon, 18 Jun 2012 19:15:56 -0700 Message-Id: <1340072156-6225-7-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: ALoCoQkTqs6OYVkhB2WkhbS7nUi5uMir08ofeimy3fitwJ2PwHqGR0znhScTRMWH2E4PGVYfMKsK Nowadays we can use prz->ecc_size as a flag, no need for the special member in the prz struct. Signed-off-by: Anton Vorontsov --- fs/pstore/ram_core.c | 10 ++++------ include/linux/pstore_ram.h | 1 - 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/fs/pstore/ram_core.c b/fs/pstore/ram_core.c index 7e5a2a9..4dabbb8 100644 --- a/fs/pstore/ram_core.c +++ b/fs/pstore/ram_core.c @@ -114,7 +114,7 @@ static void notrace persistent_ram_update_ecc(struct persistent_ram_zone *prz, int ecc_size = prz->ecc_size; int size = prz->ecc_block_size; - if (!prz->ecc) + if (!prz->ecc_size) return; block = buffer->data + (start & ~(ecc_block_size - 1)); @@ -133,7 +133,7 @@ static void persistent_ram_update_header_ecc(struct persistent_ram_zone *prz) { struct persistent_ram_buffer *buffer = prz->buffer; - if (!prz->ecc) + if (!prz->ecc_size) return; 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) uint8_t *block; uint8_t *par; - if (!prz->ecc) + if (!prz->ecc_size) return; block = buffer->data; @@ -181,7 +181,7 @@ static int persistent_ram_init_ecc(struct persistent_ram_zone *prz, int ecc_symsize = 8; int ecc_poly = 0x11d; - if (!prz->ecc) + if (!ecc_size) return 0; prz->ecc_block_size = 128; @@ -395,8 +395,6 @@ static int __devinit persistent_ram_post_init(struct persistent_ram_zone *prz, { int ret; - prz->ecc = ecc_size; - ret = persistent_ram_init_ecc(prz, ecc_size); if (ret) return ret; diff --git a/include/linux/pstore_ram.h b/include/linux/pstore_ram.h index 94b79f1..dcf805f 100644 --- a/include/linux/pstore_ram.h +++ b/include/linux/pstore_ram.h @@ -33,7 +33,6 @@ struct persistent_ram_zone { size_t buffer_size; /* ECC correction */ - bool ecc; char *par_buffer; char *par_header; struct rs_control *rs_decoder;