[coreboot-gerrit] Change in coreboot[master]: src/console: Fix coding style
Elyes HAOUAS (Code Review)
gerrit at coreboot.org
Tue May 15 21:16:43 CEST 2018
Elyes HAOUAS has uploaded this change for review. ( https://review.coreboot.org/26303
Change subject: src/console: Fix coding style
......................................................................
src/console: Fix coding style
Change-Id: I57724262ade87e7907d31ea66e4f1b9c382ef3db
Signed-off-by: Elyes HAOUAS <ehaouas at noos.fr>
---
M src/console/early_print.c
M src/console/printk.c
M src/console/vsprintf.c
M src/console/vtxprintf.c
4 files changed, 15 insertions(+), 16 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/03/26303/1
diff --git a/src/console/early_print.c b/src/console/early_print.c
index 569b99d..28f4d3f 100644
--- a/src/console/early_print.c
+++ b/src/console/early_print.c
@@ -17,9 +17,8 @@
{
unsigned char digit;
digit = nibble + '0';
- if (digit > '9') {
+ if (digit > '9')
digit += 39;
- }
console_tx_byte(digit);
}
diff --git a/src/console/printk.c b/src/console/printk.c
index c10cf97..735876e 100644
--- a/src/console/printk.c
+++ b/src/console/printk.c
@@ -78,7 +78,7 @@
return i;
}
-#if IS_ENABLED (CONFIG_VBOOT)
+#if IS_ENABLED(CONFIG_VBOOT)
void do_printk_va_list(int msg_level, const char *fmt, va_list args)
{
if (!console_log_level(msg_level))
diff --git a/src/console/vsprintf.c b/src/console/vsprintf.c
index 7071611..4892fdd 100644
--- a/src/console/vsprintf.c
+++ b/src/console/vsprintf.c
@@ -18,8 +18,7 @@
#include <string.h>
#include <trace.h>
-struct vsnprintf_context
-{
+struct vsnprintf_context {
char *str_buf;
size_t buf_limit;
};
diff --git a/src/console/vtxprintf.c b/src/console/vtxprintf.c
index 63e6703..0fb419f 100644
--- a/src/console/vtxprintf.c
+++ b/src/console/vtxprintf.c
@@ -32,7 +32,7 @@
static int skip_atoi(const char **s)
{
- int i=0;
+ int i = 0;
while (is_digit(**s))
i = i*10 + *((*s)++) - '0';
@@ -51,8 +51,8 @@
unsigned long long inum, int base, int size, int precision, int type,
void *data)
{
- char c,sign,tmp[66];
- const char *digits="0123456789abcdefghijklmnopqrstuvwxyz";
+ char c, sign, tmp[66];
+ const char *digits = "0123456789abcdefghijklmnopqrstuvwxyz";
int i;
int count = 0;
#ifdef SUPPORT_64BIT_INTS
@@ -97,11 +97,12 @@
}
i = 0;
if (num == 0)
- tmp[i++]='0';
- else while (num != 0){
- tmp[i++] = digits[num % base];
- num /= base;
- }
+ tmp[i++] = '0';
+ else
+ while (num != 0) {
+ tmp[i++] = digits[num % base];
+ num /= base;
+ }
if (i > precision)
precision = i;
size -= precision;
@@ -148,7 +149,7 @@
int count;
- for (count=0; *fmt ; ++fmt) {
+ for (count = 0; *fmt ; ++fmt) {
if (*fmt != '%') {
call_tx(*fmt), count++;
continue;
@@ -254,10 +255,10 @@
long long *ip = va_arg(args, long long *);
*ip = count;
} else if (qualifier == 'l') {
- long * ip = va_arg(args, long *);
+ long *ip = va_arg(args, long *);
*ip = count;
} else {
- int * ip = va_arg(args, int *);
+ int *ip = va_arg(args, int *);
*ip = count;
}
continue;
--
To view, visit https://review.coreboot.org/26303
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I57724262ade87e7907d31ea66e4f1b9c382ef3db
Gerrit-Change-Number: 26303
Gerrit-PatchSet: 1
Gerrit-Owner: Elyes HAOUAS <ehaouas at noos.fr>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20180515/00a2e3a4/attachment-0001.html>
More information about the coreboot-gerrit
mailing list