mtd: nand: omap: fix omap_calculate_ecc_bch() for-loop error
Subsystems (2)
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 1/1 mtd: nand: omap: fix omap_calculate_ecc_bch() for-loop error
From: "ted.juan" <[email protected]>
mtd: nand: omap: ecc.calculate: merge omap3_calculate_ecc_bch4 in omap_calculate_ecc_bch
mtd: nand: omap: ecc.calculate: merge omap3_calculate_ecc_bch8 in omap_calculate_ecc_bch
Hi Pekon,
Thanks a lot for your comments.
I hope I don't misunderstand what you say.
--- drivers/mtd/nand/omap2.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/mtd/nand/omap2.c +5 -5
@@ -1162,7 +1162,7 @@ static int __maybe_unused omap_calculate_ecc_bch(struct mtd_info *mtd,struct gpmc_nand_regs *gpmc_regs = &info->reg;u8 *ecc_code;unsigned long nsectors, bch_val1, bch_val2, bch_val3, bch_val4; -int i; +int i, j; nsectors = ((readl (info->reg.gpmc_ecc_config) >>4 ) &0x7 ) +1 ;for (i =0 ; i < nsectors; i++) {
@@ -1210,8 +1210,8 @@ static int __maybe_unused omap_calculate_ecc_bch(struct mtd_info *mtd,case OMAP_ECC_BCH4_CODE_HW_DETECTION_SW :/* Add constant polynomial to remainder, so that * ECC of blank pages results in 0x0 on reading back */ -for (i =0 ; i < eccbytes; i++) - ecc_calc[i] ^= bch4_polynomial[i]; +for (j =0 ; j < eccbytes; j++) + ecc_calc[j] ^= bch4_polynomial[j];break ;case OMAP_ECC_BCH4_CODE_HW :/* Set 8th ECC byte as 0x0 for ROM compatibility */
@@ -1220,8 +1220,8 @@ static int __maybe_unused omap_calculate_ecc_bch(struct mtd_info *mtd,case OMAP_ECC_BCH8_CODE_HW_DETECTION_SW :/* Add constant polynomial to remainder, so that * ECC of blank pages results in 0x0 on reading back */ -for (i =0 ; i < eccbytes; i++) - ecc_calc[i] ^= bch8_polynomial[i]; +for (j =0 ; j < eccbytes; j++) + ecc_calc[j] ^= bch8_polynomial[j];break ;case OMAP_ECC_BCH8_CODE_HW :/* Set 14th ECC byte as 0x0 for ROM compatibility */
Signature · 1 line
1.7.9.5
PATCH 1/1 mtd: nand: omap: fix omap_calculate_ecc_bch() for-loop error
From: "ted.juan" <[email protected]>
mtd: nand: omap: ecc.calculate: merge omap3_calculate_ecc_bch4 in omap_calculate_ecc_bch
mtd: nand: omap: ecc.calculate: merge omap3_calculate_ecc_bch8 in omap_calculate_ecc_bch
--- drivers/mtd/nand/omap2.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/mtd/nand/omap2.c +5 -5
@@ -1162,7 +1162,7 @@ static int __maybe_unused omap_calculate_ecc_bch(struct mtd_info *mtd,struct gpmc_nand_regs *gpmc_regs = &info->reg;u8 *ecc_code;unsigned long nsectors, bch_val1, bch_val2, bch_val3, bch_val4; -int i; +int i, j; nsectors = ((readl (info->reg.gpmc_ecc_config) >>4 ) &0x7 ) +1 ;for (i =0 ; i < nsectors; i++) {
@@ -1210,8 +1210,8 @@ static int __maybe_unused omap_calculate_ecc_bch(struct mtd_info *mtd,case OMAP_ECC_BCH4_CODE_HW_DETECTION_SW :/* Add constant polynomial to remainder, so that * ECC of blank pages results in 0x0 on reading back */ -for (i =0 ; i < eccbytes; i++) - ecc_calc[i] ^= bch4_polynomial[i]; +for (j =0 ; j < eccbytes; j++) + ecc_calc[j] ^= bch4_polynomial[j];break ;case OMAP_ECC_BCH4_CODE_HW :/* Set 8th ECC byte as 0x0 for ROM compatibility */
@@ -1220,8 +1220,8 @@ static int __maybe_unused omap_calculate_ecc_bch(struct mtd_info *mtd,case OMAP_ECC_BCH8_CODE_HW_DETECTION_SW :/* Add constant polynomial to remainder, so that * ECC of blank pages results in 0x0 on reading back */ -for (i =0 ; i < eccbytes; i++) - ecc_calc[i] ^= bch8_polynomial[i]; +for (j =0 ; j < eccbytes; j++) + ecc_calc[j] ^= bch8_polynomial[j];break ;case OMAP_ECC_BCH8_CODE_HW :/* Set 14th ECC byte as 0x0 for ROM compatibility */
Signature · 1 line
1.7.9.5
Hi Ted,
Sorry, this patch does not apply to l2-mtd.git. I think it conflicts with some recent changes from Pekon. Please rebase and resend.
Quoted 1 line · ted.juan
From: "ted.juan" <[email protected]>
Can you format your name properly, without the dot, for proper authorship attribution?
Quoted 9 lines
Fixes 2c9f2365d1e1d0e318b068f683f18c99515b80f8mtd: nand: omap: ecc.calculate: merge
omap3_calculate_ecc_bch4inomap_calculate_ecc_bchFixes 7bcd1dca1d587ad29f9825ba4414620440e8c8damtd: nand: omap: ecc.calculate: merge
omap3_calculate_ecc_bch8inomap_calculate_ecc_bchCC <[email protected]> # 3.13.x+Signed-off-by ted.juan <[email protected]>
Same here.
Quoted 30 lines
Acked-by Pekon Gupta <[email protected]>--- drivers/mtd/nand/omap2.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)drivers/mtd/nand/omap2.c +3
-3@@ -1162,7 +1162,7 @@ static int __maybe_unused omap_calculate_ecc_bch(struct mtd_info *mtd,struct gpmc_nand_regs *gpmc_regs = &info->reg;u8 *ecc_code;unsigned long nsectors, bch_val1, bch_val2, bch_val3, bch_val4; -int i; +int i, j; nsectors = ((readl (info->reg.gpmc_ecc_config) >>4 ) &0x7 ) +1 ;for (i =0 ; i < nsectors; i++) {@@ -1210,8 +1210,8 @@ static int __maybe_unused omap_calculate_ecc_bch(struct mtd_info *mtd,case OMAP_ECC_BCH4_CODE_HW_DETECTION_SW :/* Add constant polynomial to remainder, so that * ECC of blank pages results in 0x0 on reading back */ -for (i =0 ; i < eccbytes; i++) - ecc_calc[i] ^= bch4_polynomial[i]; +for (j =0 ; j < eccbytes; j++) + ecc_calc[j] ^= bch4_polynomial[j];break ;case OMAP_ECC_BCH4_CODE_HW :/* Set 8th ECC byte as 0x0 for ROM compatibility */
drivers/mtd/nand/omap2.c static int __maybe_unused omap_calculate_ecc_bch(struct mtd_info *mtd, · line 1227
Quoted 10 lines
drivers/mtd/nand/omap2.c +2
-2@@ -1220,8 +1220,8 @@ static int __maybe_unused omap_calculate_ecc_bch(struct mtd_info *mtd,case OMAP_ECC_BCH8_CODE_HW_DETECTION_SW :/* Add constant polynomial to remainder, so that * ECC of blank pages results in 0x0 on reading back */ -for (i =0 ; i < eccbytes; i++) - ecc_calc[i] ^= bch8_polynomial[i]; +for (j =0 ; j < eccbytes; j++) + ecc_calc[j] ^= bch8_polynomial[j];break ;case OMAP_ECC_BCH8_CODE_HW :/* Set 14th ECC byte as 0x0 for ROM compatibility */
Thanks,
Brian
PATCH 1/1 mtd: nand: omap: fix omap_calculate_ecc_bch() for-loop error
Hi Brian,
Quoted 2 lines
Quoted 2 lines
Sorry, this patch does not apply to l2-mtd.git. I think it conflicts with some recent changes from Pekon. Please rebase and resend.
ok, this should fix it.
Quoted 2 lines
Quoted 2 lines
Can you format your name properly, without the dot, for proper authorship attribution?
ok, thank you.
mtd: nand: omap: ecc.calculate: merge omap3_calculate_ecc_bch4 in omap_calculate_ecc_bch
mtd: nand: omap: ecc.calculate: merge omap3_calculate_ecc_bch8 in omap_calculate_ecc_bch
--- drivers/mtd/nand/omap2.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/mtd/nand/omap2.c +5 -5
@@ -1180,7 +1180,7 @@ static int __maybe_unused omap_calculate_ecc_bch(struct mtd_info *mtd,u8 *ecc_code;unsigned long nsectors, bch_val1, bch_val2, bch_val3, bch_val4;u32 val; -int i; +int i, j; nsectors = ((readl (info->reg.gpmc_ecc_config) >>4 ) &0x7 ) +1 ;for (i =0 ; i < nsectors; i++) {
@@ -1263,8 +1263,8 @@ static int __maybe_unused omap_calculate_ecc_bch(struct mtd_info *mtd,case OMAP_ECC_BCH4_CODE_HW_DETECTION_SW :/* Add constant polynomial to remainder, so that * ECC of blank pages results in 0x0 on reading back */ -for (i =0 ; i < eccbytes; i++) - ecc_calc[i] ^= bch4_polynomial[i]; +for (j =0 ; j < eccbytes; j++) + ecc_calc[j] ^= bch4_polynomial[j];break ;case OMAP_ECC_BCH4_CODE_HW :/* Set 8th ECC byte as 0x0 for ROM compatibility */
@@ -1273,8 +1273,8 @@ static int __maybe_unused omap_calculate_ecc_bch(struct mtd_info *mtd,case OMAP_ECC_BCH8_CODE_HW_DETECTION_SW :/* Add constant polynomial to remainder, so that * ECC of blank pages results in 0x0 on reading back */ -for (i =0 ; i < eccbytes; i++) - ecc_calc[i] ^= bch8_polynomial[i]; +for (j =0 ; j < eccbytes; j++) + ecc_calc[j] ^= bch8_polynomial[j];break ;case OMAP_ECC_BCH8_CODE_HW :/* Set 14th ECC byte as 0x0 for ROM compatibility */
Signature · 1 line
1.7.9.5
Hi Ted,
Quoted 4 lines · Ted Juan
Quoted 2 lines
Quoted 2 lines
Sorry, this patch does not apply to l2-mtd.git. I think it conflicts with some recent changes from Pekon. Please rebase and resend.
ok, this should fix it.
This is better. It still doesn't work out perfectly, since you included this conversation within the commit area. In the future, you might try testing your email by applying using 'git am' to your own tree first, just to see how it looks.
Quoted 7 lines
Quoted 2 lines
Quoted 2 lines
Can you format your name properly, without the dot, for proper authorship attribution?
ok, thank you.
Fixes 2c9f2365d1e1d0e318b068f683f18c99515b80f8
Quoted 8 lines
mtd: nand: omap: ecc.calculate: merge
omap3_calculate_ecc_bch4inomap_calculate_ecc_bchFixes 7bcd1dca1d587ad29f9825ba4414620440e8c8damtd: nand: omap: ecc.calculate: merge
omap3_calculate_ecc_bch8inomap_calculate_ecc_bchCC <[email protected]> # 3.13.x+Signed-off-by Ted Juan <[email protected]>Acked-by Pekon Gupta <[email protected]>
I fixed up the commit message slightly and pushed to l2-mtd.git. Thanks!
Quoted 29 lines
--- drivers/mtd/nand/omap2.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)drivers/mtd/nand/omap2.c +3
-3@@ -1180,7 +1180,7 @@ static int __maybe_unused omap_calculate_ecc_bch(struct mtd_info *mtd,u8 *ecc_code;unsigned long nsectors, bch_val1, bch_val2, bch_val3, bch_val4;u32 val; -int i; +int i, j; nsectors = ((readl (info->reg.gpmc_ecc_config) >>4 ) &0x7 ) +1 ;for (i =0 ; i < nsectors; i++) {@@ -1263,8 +1263,8 @@ static int __maybe_unused omap_calculate_ecc_bch(struct mtd_info *mtd,case OMAP_ECC_BCH4_CODE_HW_DETECTION_SW :/* Add constant polynomial to remainder, so that * ECC of blank pages results in 0x0 on reading back */ -for (i =0 ; i < eccbytes; i++) - ecc_calc[i] ^= bch4_polynomial[i]; +for (j =0 ; j < eccbytes; j++) + ecc_calc[j] ^= bch4_polynomial[j];break ;case OMAP_ECC_BCH4_CODE_HW :/* Set 8th ECC byte as 0x0 for ROM compatibility */
drivers/mtd/nand/omap2.c static int __maybe_unused omap_calculate_ecc_bch(struct mtd_info *mtd, · line 1280
Quoted 10 lines
drivers/mtd/nand/omap2.c +2
-2@@ -1273,8 +1273,8 @@ static int __maybe_unused omap_calculate_ecc_bch(struct mtd_info *mtd,case OMAP_ECC_BCH8_CODE_HW_DETECTION_SW :/* Add constant polynomial to remainder, so that * ECC of blank pages results in 0x0 on reading back */ -for (i =0 ; i < eccbytes; i++) - ecc_calc[i] ^= bch8_polynomial[i]; +for (j =0 ; j < eccbytes; j++) + ecc_calc[j] ^= bch8_polynomial[j];break ;case OMAP_ECC_BCH8_CODE_HW :/* Set 14th ECC byte as 0x0 for ROM compatibility */
Brian
Hi Pekon,
When I add "CC: <[email protected]> # 3.13.x+" in patch, then git send-email.
There are some warning message as blow. Should I fix it? And which stable version I should mark?
Thanks.
(mbox) Adding cc: "ted.juan" <[email protected]> from line 'From:
"ted.juan" <[email protected]>'
(body) Adding cc: <[email protected]> # 3.13.x+ from line 'CC:
<[email protected]> # 3.13.x+'
Use of uninitialized value $cc in string eq at /usr/lib/git-core/git-send-email line 983.
Use of uninitialized value $cc in quotemeta at /usr/lib/git-core/git-send-email line 983.
W: unable to extract a valid address from: <[email protected]> # 3.13.x+
W: unable to extract a valid address from: <[email protected]> # 3.13.x+
2014-05-23 10:54 GMT+08:00 ted.juan <[email protected]>:
Quoted 59 lines
From: "ted.juan" <[email protected]>
Fixes 2c9f2365d1e1d0e318b068f683f18c99515b80f8mtd: nand: omap: ecc.calculate: merge
omap3_calculate_ecc_bch4inomap_calculate_ecc_bchFixes 7bcd1dca1d587ad29f9825ba4414620440e8c8damtd: nand: omap: ecc.calculate: merge
omap3_calculate_ecc_bch8inomap_calculate_ecc_bchHi Pekon,
Thanks a lot for your comments.
I hope I don't misunderstand what you say.CC <[email protected]> # 3.13.x+Signed-off-by ted.juan <[email protected]>Acked-by Pekon Gupta <[email protected]>--- drivers/mtd/nand/omap2.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)drivers/mtd/nand/omap2.c +5
-6@@ -1162,7 +1162,7 @@ static int __maybe_unused omap_calculate_ecc_bch(struct mtd_info *mtd,struct gpmc_nand_regs *gpmc_regs = &info->reg;u8 *ecc_code;unsigned long nsectors, bch_val1, bch_val2, bch_val3, bch_val4; -int i; +int i, j; nsectors = ((readl (info->reg.gpmc_ecc_config) >>4 ) &0x7 ) +1 ;for (i =0 ; i < nsectors; i++) {@@ -1210,8 +1210,8 @@ static int __maybe_unused omap_calculate_ecc_bch(struct mtd_info *mtd,case OMAP_ECC_BCH4_CODE_HW_DETECTION_SW :/* Add constant polynomial to remainder, so that * ECC of blank pages results in 0x0 on reading back */ -for (i =0 ; i < eccbytes; i++) - ecc_calc[i] ^= bch4_polynomial[i]; +for (j =0 ; j < eccbytes; j++) + ecc_calc[j] ^= bch4_polynomial[j];break ;case OMAP_ECC_BCH4_CODE_HW :/* Set 8th ECC byte as 0x0 for ROM compatibility */ @@ -1220,8 +1220,8 @@ static int __maybe_unused omap_calculate_ecc_bch(struct mtd_info *mtd,case OMAP_ECC_BCH8_CODE_HW_DETECTION_SW :/* Add constant polynomial to remainder, so that * ECC of blank pages results in 0x0 on reading back */ -for (i =0 ; i < eccbytes; i++) - ecc_calc[i] ^= bch8_polynomial[i]; +for (j =0 ; j < eccbytes; j++) + ecc_calc[j] ^= bch8_polynomial[j];break ;case OMAP_ECC_BCH8_CODE_HW :/* Set 14th ECC byte as 0x0 for ROM compatibility */ --1.7.9.5
Hi Ted,
Quoted 8 lines
From: Ted Juan [mailto:[email protected]]
When I add "CC: <[email protected]> # 3.13.x+" in patch, then git send-email.
There are some warning message as blow. Should I fix it? And which stable version I should mark?
If I'm not wrong, below is my understanding ..
Patches marked for stable are automatically pulled-in by maintainers of stable trees when those patches get merged and tagged in linus's tree. This is done by scripts which search "CC: <[email protected]> # <tag>" in commit log of all patches. Thus "CC: <[email protected]> # 3.13.x+" here is like a marker for scripts. In practice, you should not directly send your patch to "[email protected]" mail-list, unless maintainer does so.
So, while sending stable patches use following command to avoid below error 'git send-email ---suppress-cc=bodycc'
Also refer:
http://lists.infradead.org/pipermail/linux-mtd/2014-May/053911.html
[2] Documentation/stable_kernel_rules.txt.
with regards, pekon
Quoted 13 lines
Thanks.
(mbox) Adding cc: "ted.juan" <[email protected]> from line 'From:
"ted.juan" <[email protected]>'
(body) Adding cc: <[email protected]> # 3.13.x+ from line 'CC:
<[email protected]> # 3.13.x+'
Use of uninitialized value $cc in string eq at/usr/lib/git-core/git-send-emailline 983.
Use of uninitialized value $cc in quotemeta at/usr/lib/git-core/git-send-emailline 983.
W: unable to extract a valid address from: <[email protected]> # 3.13.x+
W: unable to extract a valid address from: <[email protected]> # 3.13.x+
Hi Pekon,
Thanks for your patience to answer my question again.
Quoted 6 lines
So, while sending stable patches use following command to avoid below error 'git send-email ---suppress-cc=bodycc'
Also refer:
http://lists.infradead.org/pipermail/linux-mtd/2014-May/053911.html
[2]Documentation/stable_kernel_rules.txt.