Thread (1 message) 1 message, 1 author, 2014-03-09

[PATCH RFC 1/5] dtc: Add helpers for various message levels

From: David Gibson <hidden>
Date: 2014-03-09 11:43:19
Also in: linux-devicetree

On Thu, Feb 20, 2014 at 07:06:47PM +0100, Tomasz Figa wrote:
quoted hunk
This patch adds three helper macros to print errors, warnings and
informational messages using standard format.

Signed-off-by: Tomasz Figa <redacted>
---
 dtc.h | 3 +++
 1 file changed, 3 insertions(+)
diff --git a/dtc.h b/dtc.h
index 20de073..e95bed7 100644
--- a/dtc.h
+++ b/dtc.h
@@ -43,6 +43,9 @@
 #define debug(fmt,args...)
 #endif
 
+#define pr_err(...)	fprintf (stderr, "ERROR: " __VA_ARGS__)
+#define pr_warn(...)	fprintf (stderr, "WARNING: " __VA_ARGS__)
+#define pr_info(...)	fprintf (stderr, "INFO: " __VA_ARGS__)
So, there are already several message helper functions in dtc.
They're not all that consistently applied, so I can see an argument
for cleaning things up, and replacing them with ones modelled on the
kernel versions like these.

But.. this patch doesn't do that, it just adds yet another variant to
the mix.

In addition, what we want for messages in dtc is a bit different from
the kernel - the kernel's expexted to keep running, and the messages
log events of interest.  For dtc, for each warning/error you should
also be deciding whether that should terminate the program or not -
these helpers don't address that.

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20140309/40f9c367/attachment-0001.sig>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help