src/include: Improve code formatting

Change-Id: Ic8ffd26e61c0c3f27872699bb6aa9c39204155b7
Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr>
Reviewed-on: https://review.coreboot.org/16390
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
This commit is contained in:
Elyes HAOUAS 2016-09-01 19:01:41 +02:00 committed by Patrick Georgi
parent a15dde0719
commit 8ffd050cf0
9 changed files with 58 additions and 60 deletions

View File

@ -51,7 +51,7 @@ int do_printk(int msg_level, const char *fmt, ...) __attribute__((format(printf,
void do_putchar(unsigned char byte);
#define printk(LEVEL, fmt, args...) \
do { do_printk(LEVEL, fmt, ##args); } while(0)
do { do_printk(LEVEL, fmt, ##args); } while (0)
#else
static inline void console_init(void) {}

View File

@ -39,8 +39,7 @@ static inline __attribute__((always_inline)) msr_t rdmsr(unsigned index)
return soc_msr_read(index);
}
static inline __attribute__((always_inline)) void wrmsr(unsigned index,
msr_t msr)
static inline __attribute__((always_inline)) void wrmsr(unsigned index, msr_t msr)
{
soc_msr_write(index, msr);
}
@ -67,8 +66,7 @@ static inline __attribute__((always_inline)) msr_t rdmsr(unsigned index)
return result;
}
static inline __attribute__((always_inline)) void wrmsr(unsigned index,
msr_t msr)
static inline __attribute__((always_inline)) void wrmsr(unsigned index, msr_t msr)
{
__asm__ __volatile__ (
"wrmsr"

View File

@ -4,7 +4,7 @@
#if CONFIG_HAVE_HARD_RESET
void hard_reset(void);
#else
#define hard_reset() do {} while(0)
#define hard_reset() do {} while (0)
#endif
void soft_reset(void);
void cpu_reset(void);

View File

@ -6,12 +6,12 @@
#else /* !CONFIG_SMP */
#define DECLARE_SPIN_LOCK(x)
#define barrier() do {} while(0)
#define barrier() do {} while (0)
#define spin_is_locked(lock) 0
#define spin_unlock_wait(lock) do {} while(0)
#define spin_lock(lock) do {} while(0)
#define spin_unlock(lock) do {} while(0)
#define cpu_relax() do {} while(0)
#define spin_unlock_wait(lock) do {} while (0)
#define spin_lock(lock) do {} while (0)
#define spin_unlock(lock) do {} while (0)
#define cpu_relax() do {} while (0)
#endif
#endif /* SMP_SPINLOCK_H */

View File

@ -24,7 +24,7 @@ int snprintf(char * buf, size_t size, const char *fmt, ...);
static inline size_t strnlen(const char *src, size_t max)
{
size_t i = 0;
while((*src++) && (i < max)) {
while ((*src++) && (i < max)) {
i++;
}
return i;
@ -33,7 +33,7 @@ static inline size_t strnlen(const char *src, size_t max)
static inline size_t strlen(const char *src)
{
size_t i = 0;
while(*src++) {
while (*src++) {
i++;
}
return i;

View File

@ -4,7 +4,7 @@
#if CONFIG_USE_WATCHDOG_ON_BOOT
void watchdog_off(void);
#else
#define watchdog_off() while(0) {}
#define watchdog_off() while (0) {}
#endif
#endif /* WATCHDOG_H */