OneNAND: Destaticize largepage_memorybased
PATCH 1/1 OneNAND: Destaticize largepage_memorybased
This moves "struct nand_bbt_descr largepage_memorybased" into .data.rel, which allows it to be PIC with current U-Boot infrastructure for relocation.
Also, I squished the ff_patternt into the structure.
--- drivers/mtd/onenand/onenand_bbt.c | 6 ++---- 1 files changed, 2 insertions(+), 4 deletions(-)
drivers/mtd/onenand/onenand_bbt.c +2 -4
@@ -231,13 +231,11 @@ int onenand_scan_bbt(struct mtd_info *mtd, struct nand_bbt_descr *bd)* Define some generic bad / good block scan pattern which are used * while scanning a device for factory marked good / bad blocks. */ -static uint8_t scan_ff_pattern[] = {0xff ,0xff }; - -static struct nand_bbt_descr largepage_memorybased = { +struct nand_bbt_descr largepage_memorybased = { .options =0 , .offs =0 , .len =2 , - .pattern = scan_ff_pattern, + .pattern = {0xff ,0xff }, };/**
Signature · 1 line
1.7.1
PATCH 1/1 OneNAND: Destaticize largepage_memorybased
Dne So 2. ??jna 2010 16:26:07 Marek Vasut napsal(a):
Quoted 5 lines
This moves "struct
nand_bbt_descrlargepage_memorybased" into .data.rel, which allows it to be PIC with current U-Boot infrastructure for relocation.Also, I squished the
ff_patterntinto the structure.
Please ignore this one, the linker is playing weird games with me ...
Quoted 27 lines
Signed-off-by Marek Vasut <[email protected]>--- drivers/mtd/onenand/onenand_bbt.c | 6 ++---- 1 files changed, 2 insertions(+), 4 deletions(-)(quoted diff) +0
-0
b/drivers/mtd/onenand/onenand_bbt.cindex 1354877..c6d1dc9 100644drivers/mtd/onenand/onenand_bbt.c +0
-0@@ -231,13 +231,11 @@ int onenand_scan_bbt(struct mtd_info *mtd, struct
nand_bbt_descr*bd) * Define some generic bad / good block scan pattern which are used * while scanning a device for factory marked good / bad blocks.
*/drivers/mtd/onenand/onenand_bbt.c +2
-4-static uint8_t scan_ff_pattern[] = {0xff ,0xff }; - -static struct nand_bbt_descr largepage_memorybased = { +struct nand_bbt_descr largepage_memorybased = { .options =0 , .offs =0 , .len =2 , - .pattern = scan_ff_pattern, + .pattern = {0xff ,0xff }, };/**
Wolfgang Denk
NAKPATCH 1/1 OneNAND: Destaticize largepage_memorybased
In reply to Marek VasutDear Marek Vasut,
Quoted 18 lines · In message <[email protected]> you wrote:
This moves "struct
nand_bbt_descrlargepage_memorybased" into .data.rel, which allows it to be PIC with current U-Boot infrastructure for relocation.Also, I squished the
ff_patterntinto the structure.Signed-off-by Marek Vasut <[email protected]>--- drivers/mtd/onenand/onenand_bbt.c | 6 ++---- 1 files changed, 2 insertions(+), 4 deletions(-)drivers/mtd/onenand/onenand_bbt.c +0
-0@@ -231,13 +231,11 @@ int onenand_scan_bbt(struct mtd_info *mtd, struct nand_bbt_descr *bd)* Define some generic bad / good block scan pattern which are used * while scanning a device for factory marked good / bad blocks. */
drivers/mtd/onenand/onenand_bbt.c int onenand_scan_bbt(struct mtd_info *mtd, struct nand_bbt_descr *bd) · line 239
Quoted 10 lines
drivers/mtd/onenand/onenand_bbt.c +2
-4-static uint8_t scan_ff_pattern[] = {0xff ,0xff }; - -static struct nand_bbt_descr largepage_memorybased = { +struct nand_bbt_descr largepage_memorybased = { .options =0 , .offs =0 , .len =2 , - .pattern = scan_ff_pattern, + .pattern = {0xff ,0xff }, };
NAK.
We don't want to make static data globally visible.
If there is an issue with relocation of such data on ARM, we need to fix that.
Best regards,
Wolfgang Denk
Signature · 6 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"The more data I punch in this card, the lighter it becomes, and the
lower the mailing cost."
- Stan Kelly-Bootle, "The Devil's DP Dictionary"