Skip to content
Snippets Groups Projects
Commit bd2a23ac authored by Igor Grinberg's avatar Igor Grinberg Committed by Stefano Babic
Browse files

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: default avatarIgor Grinberg <grinberg@compulab.co.il>
parent e8db8f71
Branches
Tags
No related merge requests found
......@@ -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__ = {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment