From: Charles Manning <manningc2@actrix.gen.nz>
To: linux-mtd@lists.infradead.org
Subject: Marginally faster nand_ecc.c
Date: Sat, 23 Sep 2006 09:58:42 +1200 [thread overview]
Message-ID: <200609230958.43000.manningc2@actrix.gen.nz> (raw)
[-- Attachment #1: Type: text/plain, Size: 299 bytes --]
Folks
Herewith a patch that speeds up nand_ecc.c slightly. This should speed it up
to be the same as yaffs_ecc.c which runs approx 15% faster than regular
nand_ecc.c in the tests I have done.
All we're doing is moving the masking to outside the loop so we only take the
hit once.
-- CHarles
[-- Attachment #2: nand_ecc_patch --]
[-- Type: text/x-diff, Size: 469 bytes --]
--- nand_ecc.c.orig 2006-09-23 09:51:09.000000000 +1200
+++ nand_ecc.c 2006-09-23 09:52:12.000000000 +1200
@@ -128,7 +128,7 @@
/* Get CP0 - CP5 from table */
idx = nand_ecc_precalc_table[dat[j]];
- reg1 ^= (idx & 0x3f);
+ reg1 ^= idx;
/* All bit XOR = 1 ? */
if (idx & 0x40) {
@@ -136,6 +136,8 @@
reg2 ^= ~((u_char) j);
}
}
+
+ reg1 &= 0x3f;
/* Create non-inverted ECC code from line parity */
nand_trans_result(reg2, reg3, ecc_code);
reply other threads:[~2006-09-22 21:54 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=200609230958.43000.manningc2@actrix.gen.nz \
--to=manningc2@actrix.gen.nz \
--cc=linux-mtd@lists.infradead.org \
/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