aboutsummaryrefslogtreecommitdiff
path: root/common/log_console.c
diff options
context:
space:
mode:
authorHeinrich Schuchardt <xypron.glpk@gmx.de>2020-06-17 21:52:45 +0200
committerSimon Glass <sjg@chromium.org>2020-07-09 18:57:22 -0600
commitdde173a204e14a243855ce5414820d61bcc80539 (patch)
tree77d64e4efc9db065d96d0a66746aaab441870c9f /common/log_console.c
parent3c21d7738a793bb7713df5ac4de434c680fa249f (diff)
downloadu-boot-dde173a204e14a243855ce5414820d61bcc80539.zip
u-boot-dde173a204e14a243855ce5414820d61bcc80539.tar.gz
u-boot-dde173a204e14a243855ce5414820d61bcc80539.tar.bz2
log: use BIT() instead of 1 <<
Use the BIT() macro when creating a bitmask for the logging fields. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'common/log_console.c')
-rw-r--r--common/log_console.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/common/log_console.c b/common/log_console.c
index 0b5b708..bb3f846 100644
--- a/common/log_console.c
+++ b/common/log_console.c
@@ -25,18 +25,18 @@ static int log_console_emit(struct log_device *ldev, struct log_rec *rec)
* - function is an identifier and ends with ()
* - message has a space before it unless it is on its own
*/
- if (fmt & (1 << LOGF_LEVEL))
+ if (fmt & BIT(LOGF_LEVEL))
printf("%s.", log_get_level_name(rec->level));
- if (fmt & (1 << LOGF_CAT))
+ if (fmt & BIT(LOGF_CAT))
printf("%s,", log_get_cat_name(rec->cat));
- if (fmt & (1 << LOGF_FILE))
+ if (fmt & BIT(LOGF_FILE))
printf("%s:", rec->file);
- if (fmt & (1 << LOGF_LINE))
+ if (fmt & BIT(LOGF_LINE))
printf("%d-", rec->line);
- if (fmt & (1 << LOGF_FUNC))
+ if (fmt & BIT(LOGF_FUNC))
printf("%s()", rec->func);
- if (fmt & (1 << LOGF_MSG))
- printf("%s%s", fmt != (1 << LOGF_MSG) ? " " : "", rec->msg);
+ if (fmt & BIT(LOGF_MSG))
+ printf("%s%s", fmt != BIT(LOGF_MSG) ? " " : "", rec->msg);
return 0;
}