From patchwork Tue Jul 10 00:03:20 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Vorontsov X-Patchwork-Id: 9906 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 33E5723E01 for ; Tue, 10 Jul 2012 00:06:58 +0000 (UTC) Received: from mail-gh0-f180.google.com (mail-gh0-f180.google.com [209.85.160.180]) by fiordland.canonical.com (Postfix) with ESMTP id 5A3ACA18744 for ; Tue, 10 Jul 2012 00:06:56 +0000 (UTC) Received: by mail-gh0-f180.google.com with SMTP id z12so11495049ghb.11 for ; Mon, 09 Jul 2012 17:06:56 -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=jF5zs6FVxsDzbVjPpKlbu2VY2KuNsEotDfQAtPxukf24lBwQse3SyREDiAWNfZp//Q MltzgSGsXIr6NXi0+5ef5T1zOTCfY+LWV49CsFrU1a2b1aNGcSMR5e04HVswCfWrr68c NzDFq+iUVxqkFX/PE87ciaDn7ZpUheDTW2gYE6LOFUuuXnGCrwlNABIBGa52w0Wj0BPp LjrxcVXIEe4ttSEtw+iFwDwPVA6JjilIehv2kIidaRCZjqLJJZKWWP06yeo0Nxgqracn w7WxLFGCHOdTGouUj0FNCKNzLV7O3fnKnFfI5Q332IaXYSWWKwGfn1Ww6hfssi8ZLXrE /zIQ== Received: by 10.50.57.167 with SMTP id j7mr9711163igq.53.1341878816017; Mon, 09 Jul 2012 17:06:56 -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 v20csp42607ibb; Mon, 9 Jul 2012 17:06:55 -0700 (PDT) Received: by 10.66.73.70 with SMTP id j6mr69326922pav.5.1341878814582; Mon, 09 Jul 2012 17:06:54 -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 tg7si58992990pbc.69.2012.07.09.17.06.54 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 09 Jul 2012 17:06:54 -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 rr4so23724078pbb.37 for ; Mon, 09 Jul 2012 17:06:54 -0700 (PDT) Received: by 10.68.225.201 with SMTP id rm9mr64039540pbc.71.1341878814307; Mon, 09 Jul 2012 17:06:54 -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 gj8sm28649014pbc.39.2012.07.09.17.06.52 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 09 Jul 2012 17:06:53 -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 3/3] pstore/ram_core: Get rid of prz->ecc enable/disable flag Date: Mon, 9 Jul 2012 17:03:20 -0700 Message-Id: <1341878600-2139-3-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: ALoCoQlRRrz4Oi1nG1Hj67Bsss8HVq3cv9BVJ/FhQYGJYT4pu9lKXyu+BAZaLMkEV6xvg2mf9KXJ 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;