From: Sean Anderson <seanga2@gmail.com>
To: u-boot@lists.denx.de
Subject: [PATCH 3/4] dm: Use symbolic constants for log levels in dev_xxx()
Date: Sat, 12 Sep 2020 20:28:20 -0400 [thread overview]
Message-ID: <20200913002821.404022-4-seanga2@gmail.com> (raw)
In-Reply-To: <20200913002821.404022-1-seanga2@gmail.com>
This substitutes literal log levels with their symbolic constants.
Signed-off-by: Sean Anderson <seanga2@gmail.com>
---
include/dm/device_compat.h | 21 +++++++++++----------
1 file changed, 11 insertions(+), 10 deletions(-)
diff --git a/include/dm/device_compat.h b/include/dm/device_compat.h
index 3d8cd09f4c..7c14aa464d 100644
--- a/include/dm/device_compat.h
+++ b/include/dm/device_compat.h
@@ -10,6 +10,7 @@
#ifndef _DM_DEVICE_COMPAT_H
#define _DM_DEVICE_COMPAT_H
+#include <log.h>
#include <linux/compat.h>
/*
@@ -48,28 +49,28 @@
})
#define dev_emerg(dev, fmt, ...) \
- __dev_printk(0, dev, fmt, ##__VA_ARGS__)
+ __dev_printk(LOGL_EMERG, dev, fmt, ##__VA_ARGS__)
#define dev_alert(dev, fmt, ...) \
- __dev_printk(1, dev, fmt, ##__VA_ARGS__)
+ __dev_printk(LOGL_ALERT, dev, fmt, ##__VA_ARGS__)
#define dev_crit(dev, fmt, ...) \
- __dev_printk(2, dev, fmt, ##__VA_ARGS__)
+ __dev_printk(LOGL_CRIT, dev, fmt, ##__VA_ARGS__)
#define dev_err(dev, fmt, ...) \
- __dev_printk(3, dev, fmt, ##__VA_ARGS__)
+ __dev_printk(LOGL_ERR, dev, fmt, ##__VA_ARGS__)
#define dev_warn(dev, fmt, ...) \
- __dev_printk(4, dev, fmt, ##__VA_ARGS__)
+ __dev_printk(LOGL_WARNING, dev, fmt, ##__VA_ARGS__)
#define dev_notice(dev, fmt, ...) \
- __dev_printk(5, dev, fmt, ##__VA_ARGS__)
+ __dev_printk(LOGL_NOTICE, dev, fmt, ##__VA_ARGS__)
#define dev_info(dev, fmt, ...) \
- __dev_printk(6, dev, fmt, ##__VA_ARGS__)
+ __dev_printk(LOGL_INFO, dev, fmt, ##__VA_ARGS__)
#ifdef DEBUG
#define dev_dbg(dev, fmt, ...) \
- __dev_printk(7, dev, fmt, ##__VA_ARGS__)
+ __dev_printk(LOGL_DEBUG, dev, fmt, ##__VA_ARGS__)
#else
#define dev_dbg(dev, fmt, ...) \
({ \
if (0) \
- __dev_printk(7, dev, fmt, ##__VA_ARGS__); \
+ __dev_printk(LOGL_DEBUG, dev, fmt, ##__VA_ARGS__); \
})
#endif
@@ -79,7 +80,7 @@
#define dev_vdbg(dev, fmt, ...) \
({ \
if (0) \
- __dev_printk(7, dev, fmt, ##__VA_ARGS__); \
+ __dev_printk(LOGL_DEBUG, dev, fmt, ##__VA_ARGS__); \
})
#endif
--
2.28.0
next prev parent reply other threads:[~2020-09-13 0:28 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-13 0:28 [PATCH 0/4] dm: Print device name in dev_xxx() like Linux Sean Anderson
2020-09-13 0:28 ` [PATCH 1/4] remoteproc: Remove unused function rproc_elf_sanity_check Sean Anderson
2020-09-17 1:09 ` Simon Glass
2020-09-13 0:28 ` [PATCH 2/4] net: mdio: Supply appropriate devices for dev_dgb calls Sean Anderson
2020-09-17 1:09 ` Simon Glass
2020-09-17 1:40 ` Sean Anderson
2020-09-17 3:44 ` Simon Glass
2020-09-13 0:28 ` Sean Anderson [this message]
2020-09-17 1:09 ` [PATCH 3/4] dm: Use symbolic constants for log levels in dev_xxx() Simon Glass
2020-09-13 0:28 ` [PATCH 4/4] dm: Print device name in dev_xxx() like Linux Sean Anderson
2020-09-13 1:43 ` [PATCH 0/4] " Sean Anderson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200913002821.404022-4-seanga2@gmail.com \
--to=seanga2@gmail.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox