From b919ec25e77afc05d91f9a7fec747de53de83fa3 Mon Sep 17 00:00:00 2001 From: Igor Grinberg Date: Mon, 7 Nov 2011 01:14:03 +0000 Subject: [PATCH] env: clean env_onenand.c checkpatch and code style Cleanup the env_onenand.c checkpatch warnings, errors and coding style. Signed-off-by: Igor Grinberg --- common/env_onenand.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/common/env_onenand.c b/common/env_onenand.c index 618c642f29..0ad2fc7a4c 100644 --- a/common/env_onenand.c +++ b/common/env_onenand.c @@ -31,14 +31,12 @@ #include #include #include +#include #include #include #include -extern struct mtd_info onenand_mtd; -extern struct onenand_chip onenand_chip; - char *env_name_spec = "OneNAND"; #define ONENAND_MAX_ENV_SIZE 4096 @@ -48,7 +46,7 @@ DECLARE_GLOBAL_DATA_PTR; uchar env_get_char_spec(int index) { - return (*((uchar *)(gd->env_addr + index))); + return *((uchar *)(gd->env_addr + index)); } void env_relocate_spec(void) @@ -76,7 +74,7 @@ void env_relocate_spec(void) if (mtd->writesize) /* Ignore read fail */ mtd->read(mtd, env_addr, ONENAND_MAX_ENV_SIZE, - &retlen, (u_char *)buf); + &retlen, (u_char *)buf); else mtd->writesize = MAX_ONENAND_PAGESIZE; #endif /* !ENV_IS_EMBEDDED */ @@ -126,7 +124,7 @@ int saveenv(void) } if (mtd->write(mtd, env_addr, ONENAND_MAX_ENV_SIZE, &retlen, - (u_char *)&env_new)) { + (u_char *)&env_new)) { printf("OneNAND: write failed at 0x%llx\n", instr.addr); return 2; } @@ -137,7 +135,7 @@ int saveenv(void) int env_init(void) { /* use default */ - gd->env_addr = (ulong) & default_environment[0]; + gd->env_addr = (ulong)&default_environment[0]; gd->env_valid = 1; return 0; -- 2.39.5