diff options
author | Igor Grinberg | 2011-11-07 01:14:03 +0000 |
---|---|---|
committer | Stefano Babic | 2011-11-22 08:39:26 +0100 |
commit | b919ec25e77afc05d91f9a7fec747de53de83fa3 (patch) | |
tree | cbc042aeaea8cbc99dd653d6d80babe2a82e6ca6 /common | |
parent | 0901d9f891a335826abb1b0d053d66a81b9a0996 (diff) |
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 <grinberg@compulab.co.il>
Diffstat (limited to 'common')
-rw-r--r-- | common/env_onenand.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/common/env_onenand.c b/common/env_onenand.c index 618c642f29c..0ad2fc7a4cd 100644 --- a/common/env_onenand.c +++ b/common/env_onenand.c @@ -31,14 +31,12 @@ #include <malloc.h> #include <search.h> #include <errno.h> +#include <onenand_uboot.h> #include <linux/mtd/compat.h> #include <linux/mtd/mtd.h> #include <linux/mtd/onenand.h> -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; |