[RFC] Rename SECTOR_SIZE to DOC_SECTOR_SIZE

From: Chris Wedgwood
Date: Wed Oct 27 2004 - 01:21:48 EST


The token SECTOR_SIZE is used in multiple places that have (almost)
the same defintion everywhere.

How do people feel about rename this vague token?



===== drivers/mtd/devices/docecc.c 1.7 vs edited =====
--- 1.7/drivers/mtd/devices/docecc.c 2003-05-28 08:01:02 -07:00
+++ edited/drivers/mtd/devices/docecc.c 2004-10-26 17:10:26 -07:00
@@ -431,9 +431,9 @@ eras_dec_rs(dtype Alpha_to[NN + 1], dtyp
/***************************************************************************/
/* The DOC specific code begins here */

-#define SECTOR_SIZE 512
+#define DOC_SECTOR_SIZE 512
/* The sector bytes are packed into NB_DATA MM bits words */
-#define NB_DATA (((SECTOR_SIZE + 1) * 8 + 6) / MM)
+#define NB_DATA (((DOC_SECTOR_SIZE + 1) * 8 + 6) / MM)

/*
* Correct the errors in 'sector[]' by using 'ecc1[]' which is the
@@ -441,7 +441,7 @@ eras_dec_rs(dtype Alpha_to[NN + 1], dtyp
* the ECC. Return the number of errors corrected (and correct them in
* sector), or -1 if error
*/
-int doc_decode_ecc(unsigned char sector[SECTOR_SIZE], unsigned char ecc1[6])
+int doc_decode_ecc(unsigned char sector[DOC_SECTOR_SIZE], unsigned char ecc1[6])
{
int parity, i, nb_errors;
gf bb[NN - KK + 1];
@@ -488,22 +488,22 @@ int doc_decode_ecc(unsigned char sector[
can be modified since pos is even */
index = (pos >> 3) ^ 1;
bitpos = pos & 7;
- if ((index >= 0 && index < SECTOR_SIZE) ||
- index == (SECTOR_SIZE + 1)) {
+ if ((index >= 0 && index < DOC_SECTOR_SIZE) ||
+ index == (DOC_SECTOR_SIZE + 1)) {
val = error_val[i] >> (2 + bitpos);
parity ^= val;
- if (index < SECTOR_SIZE)
+ if (index < DOC_SECTOR_SIZE)
sector[index] ^= val;
}
index = ((pos >> 3) + 1) ^ 1;
bitpos = (bitpos + 10) & 7;
if (bitpos == 0)
bitpos = 8;
- if ((index >= 0 && index < SECTOR_SIZE) ||
- index == (SECTOR_SIZE + 1)) {
+ if ((index >= 0 && index < DOC_SECTOR_SIZE) ||
+ index == (DOC_SECTOR_SIZE + 1)) {
val = error_val[i] << (8 - bitpos);
parity ^= val;
- if (index < SECTOR_SIZE)
+ if (index < DOC_SECTOR_SIZE)
sector[index] ^= val;
}
}
===== drivers/mtd/nand/diskonchip.c 1.6 vs edited =====
--- 1.6/drivers/mtd/nand/diskonchip.c 2004-10-20 16:34:39 -07:00
+++ edited/drivers/mtd/nand/diskonchip.c 2004-10-26 17:10:26 -07:00
@@ -128,9 +128,9 @@ MODULE_PARM_DESC(doc_config_location, "P


/* Sector size for HW ECC */
-#define SECTOR_SIZE 512
+#define DOC_SECTOR_SIZE 512
/* The sector bytes are packed into NB_DATA 10 bit words */
-#define NB_DATA (((SECTOR_SIZE + 1) * 8 + 6) / 10)
+#define NB_DATA (((DOC_SECTOR_SIZE + 1) * 8 + 6) / 10)
/* Number of roots */
#define NROOTS 4
/* First consective root */
@@ -208,22 +208,22 @@ static int doc_ecc_decode (struct rs_con
can be modified since pos is even */
index = (pos >> 3) ^ 1;
bitpos = pos & 7;
- if ((index >= 0 && index < SECTOR_SIZE) ||
- index == (SECTOR_SIZE + 1)) {
+ if ((index >= 0 && index < DOC_SECTOR_SIZE) ||
+ index == (DOC_SECTOR_SIZE + 1)) {
val = (uint8_t) (errval[i] >> (2 + bitpos));
parity ^= val;
- if (index < SECTOR_SIZE)
+ if (index < DOC_SECTOR_SIZE)
data[index] ^= val;
}
index = ((pos >> 3) + 1) ^ 1;
bitpos = (bitpos + 10) & 7;
if (bitpos == 0)
bitpos = 8;
- if ((index >= 0 && index < SECTOR_SIZE) ||
- index == (SECTOR_SIZE + 1)) {
+ if ((index >= 0 && index < DOC_SECTOR_SIZE) ||
+ index == (DOC_SECTOR_SIZE + 1)) {
val = (uint8_t)(errval[i] << (8 - bitpos));
parity ^= val;
- if (index < SECTOR_SIZE)
+ if (index < DOC_SECTOR_SIZE)
data[index] ^= val;
}
}
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/