From dde173a204e14a243855ce5414820d61bcc80539 Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Wed, 17 Jun 2020 21:52:45 +0200 Subject: log: use BIT() instead of 1 << Use the BIT() macro when creating a bitmask for the logging fields. Signed-off-by: Heinrich Schuchardt Reviewed-by: Simon Glass --- common/log_console.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'common/log_console.c') diff --git a/common/log_console.c b/common/log_console.c index 0b5b7089af8..bb3f8464b98 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; } -- cgit v1.2.3