env: clean env_embedded.c checkpatch and code style

Cleanup the env_embedded.c checkpatch warnings, errors and coding style.
There is one error left though:
 ERROR: Macros with multiple statements should be enclosed in a do - while loop
 #79: FILE: u-boot/common/env_embedded.c:79:
 +#define GEN_ABS(name, value)                   \
 +       asm(".globl " GEN_SYMNAME(name));       \
 +       GEN_SET_VALUE(name, value)

 total: 1 errors, 0 warnings, 213 lines checked

We cannot enclose that statement in a do - while loop,
because these are a global assembly declarations.

Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
This commit is contained in:
Igor Grinberg 2011-11-07 01:14:06 +00:00 committed by Stefano Babic
parent e8db8f71c9
commit bd2a23ac61
1 changed files with 22 additions and 23 deletions

View File

@ -29,10 +29,7 @@
#undef __ASSEMBLY__
#include <environment.h>
/*
* Handle HOSTS that have prepended
* crap on symbol names, not TARGETS.
*/
/* Handle HOSTS that have prepended crap on symbol names, not TARGETS. */
#if defined(__APPLE__)
/* Leading underscore on symbols */
# define SYM_CHAR "_"
@ -71,9 +68,11 @@
* Macros to generate global absolutes.
*/
#if defined(__bfin__)
# define GEN_SET_VALUE(name, value) asm (".set " GEN_SYMNAME(name) ", " GEN_VALUE(value))
# define GEN_SET_VALUE(name, value) \
asm(".set " GEN_SYMNAME(name) ", " GEN_VALUE(value))
#else
# define GEN_SET_VALUE(name, value) asm (GEN_SYMNAME(name) " = " GEN_VALUE(value))
# define GEN_SET_VALUE(name, value) \
asm(GEN_SYMNAME(name) " = " GEN_VALUE(value))
#endif
#define GEN_SYMNAME(str) SYM_CHAR #str
#define GEN_VALUE(str) #str
@ -93,7 +92,7 @@
* computed CRC. Otherwise define it as ~0.
*/
#if !defined(ENV_CRC)
# define ENV_CRC ~0
# define ENV_CRC (~0)
#endif
env_t environment __PPCENV__ = {