c78952
From 8c4b2eaa204f0ea0377ca4592d2be6029fdb9be7 Mon Sep 17 00:00:00 2001
f4c76c
From: Peter Jones <pjones@redhat.com>
f4c76c
Date: Sun, 28 Jun 2015 13:09:58 -0400
31cddd
Subject: [PATCH] Add grub_qdprintf() - grub_dprintf() without the
f4c76c
 file+line number.
f4c76c
f4c76c
This just makes copy+paste of our debug loading info easier.
f4c76c
f4c76c
Signed-off-by: Peter Jones <pjones@redhat.com>
f4c76c
---
f4c76c
 grub-core/kern/misc.c | 18 ++++++++++++++++++
f4c76c
 include/grub/misc.h   |  2 ++
f4c76c
 2 files changed, 20 insertions(+)
f4c76c
f4c76c
diff --git a/grub-core/kern/misc.c b/grub-core/kern/misc.c
78e1a1
index 5c2d2039d0b..0e89c483d5e 100644
f4c76c
--- a/grub-core/kern/misc.c
f4c76c
+++ b/grub-core/kern/misc.c
78e1a1
@@ -190,6 +190,24 @@ grub_real_dprintf (const char *file, const int line, const char *condition,
f4c76c
     }
f4c76c
 }
f4c76c
 
f4c76c
+void
f4c76c
+grub_qdprintf (const char *condition, const char *fmt, ...)
f4c76c
+{
f4c76c
+  va_list args;
f4c76c
+  const char *debug = grub_env_get ("debug");
f4c76c
+
f4c76c
+  if (! debug)
f4c76c
+    return;
f4c76c
+
f4c76c
+  if (grub_strword (debug, "all") || grub_strword (debug, condition))
f4c76c
+    {
f4c76c
+      va_start (args, fmt);
f4c76c
+      grub_vprintf (fmt, args);
f4c76c
+      va_end (args);
f4c76c
+      grub_refresh ();
f4c76c
+    }
f4c76c
+}
f4c76c
+
f4c76c
 #define PREALLOC_SIZE 255
f4c76c
 
f4c76c
 int
f4c76c
diff --git a/include/grub/misc.h b/include/grub/misc.h
78e1a1
index 493e328d968..4607e8defa9 100644
f4c76c
--- a/include/grub/misc.h
f4c76c
+++ b/include/grub/misc.h
78e1a1
@@ -372,6 +372,8 @@ void EXPORT_FUNC(grub_real_dprintf) (const char *file,
f4c76c
                                      const int line,
f4c76c
                                      const char *condition,
f4c76c
                                      const char *fmt, ...) __attribute__ ((format (GNU_PRINTF, 4, 5)));
f4c76c
+void EXPORT_FUNC(grub_qdprintf) (const char *condition,
f4c76c
+				 const char *fmt, ...) __attribute__ ((format (GNU_PRINTF, 2, 3)));
f4c76c
 int EXPORT_FUNC(grub_vprintf) (const char *fmt, va_list args);
f4c76c
 int EXPORT_FUNC(grub_snprintf) (char *str, grub_size_t n, const char *fmt, ...)
f4c76c
      __attribute__ ((format (GNU_PRINTF, 3, 4)));