File: Revert-kern-Include-function-name-on-debug-and-error-prin.patch

package info (click to toggle)
grub2 2.14-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 81,540 kB
  • sloc: ansic: 550,889; asm: 68,074; sh: 9,818; cpp: 2,095; makefile: 1,916; python: 1,546; sed: 450; lex: 393; yacc: 268; awk: 85; lisp: 54; perl: 31
file content (98 lines) | stat: -rw-r--r-- 4,204 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
From: Mate Kukri <mate.kukri@canonical.com>
Date: Tue, 10 Feb 2026 10:42:37 +0000
Subject: Revert "kern: Include function name on debug and error print
 functions"

This reverts commit 894241c8543eb0dd27b16962a640f38e9b0c6e19.
---
 grub-core/kern/err.c  | 4 ++--
 grub-core/kern/misc.c | 4 ++--
 include/grub/err.h    | 6 +++---
 include/grub/misc.h   | 5 ++---
 4 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/grub-core/kern/err.c b/grub-core/kern/err.c
index ba04b57..aebfe0c 100644
--- a/grub-core/kern/err.c
+++ b/grub-core/kern/err.c
@@ -38,14 +38,14 @@ static int grub_error_stack_assert;
 #endif
 
 grub_err_t
-grub_error (grub_err_t n, const char *file, const char *function, const int line, const char *fmt, ...)
+grub_error (grub_err_t n, const char *file, const int line, const char *fmt, ...)
 {
   va_list ap;
   int m;
 
   grub_errno = n;
 
-  m = grub_snprintf (grub_errmsg, sizeof (grub_errmsg), "%s:%s:%d:", file, function, line);
+  m = grub_snprintf (grub_errmsg, sizeof (grub_errmsg), "%s:%d:", file, line);
   if (m < 0)
     m = 0;
 
diff --git a/grub-core/kern/misc.c b/grub-core/kern/misc.c
index 18c34b8..91f44de 100644
--- a/grub-core/kern/misc.c
+++ b/grub-core/kern/misc.c
@@ -263,14 +263,14 @@ grub_debug_enabled (const char * condition)
 }
 
 void
-grub_real_dprintf (const char *file, const char *function, const int line, const char *condition,
+grub_real_dprintf (const char *file, const int line, const char *condition,
 		   const char *fmt, ...)
 {
   va_list args;
 
   if (grub_debug_enabled (condition))
     {
-      grub_printf ("%s:%s:%d:%s: ", file, function, line, condition);
+      grub_printf ("%s:%d:%s: ", file, line, condition);
       va_start (args, fmt);
       grub_vprintf (fmt, args);
       va_end (args);
diff --git a/include/grub/err.h b/include/grub/err.h
index 99e757a..4b02d13 100644
--- a/include/grub/err.h
+++ b/include/grub/err.h
@@ -89,10 +89,10 @@ struct grub_error_saved
 extern grub_err_t EXPORT_VAR(grub_errno);
 extern char EXPORT_VAR(grub_errmsg)[GRUB_MAX_ERRMSG];
 
-grub_err_t EXPORT_FUNC(grub_error) (grub_err_t n, const char *file, const char *function, const int line, const char *fmt, ...)
-	__attribute__ ((format (GNU_PRINTF, 5, 6)));
+grub_err_t EXPORT_FUNC(grub_error) (grub_err_t n, const char *file, const int line, const char *fmt, ...)
+	__attribute__ ((format (GNU_PRINTF, 4, 5)));
 
-#define grub_error(n, fmt, ...) grub_error (n, __FILE__, __FUNCTION__, __LINE__, fmt, ##__VA_ARGS__)
+#define grub_error(n, fmt, ...) grub_error (n, __FILE__, __LINE__, fmt, ##__VA_ARGS__)
 
 void EXPORT_FUNC(grub_fatal) (const char *fmt, ...) __attribute__ ((noreturn));
 void EXPORT_FUNC(grub_error_push) (void);
diff --git a/include/grub/misc.h b/include/grub/misc.h
index 1bb6323..62be0b9 100644
--- a/include/grub/misc.h
+++ b/include/grub/misc.h
@@ -35,7 +35,7 @@
 #define ARRAY_SIZE(array) (sizeof (array) / sizeof (array[0]))
 #define COMPILE_TIME_ASSERT(cond) switch (0) { case 1: case !(cond): ; }
 
-#define grub_dprintf(condition, ...) grub_real_dprintf(GRUB_FILE, __FUNCTION__, __LINE__, condition, __VA_ARGS__)
+#define grub_dprintf(condition, ...) grub_real_dprintf(GRUB_FILE, __LINE__, condition, __VA_ARGS__)
 
 void *EXPORT_FUNC(grub_memmove) (void *dest, const void *src, grub_size_t n);
 void *EXPORT_FUNC(grub_memcpy) (void *dest, const void *src, grub_size_t n);
@@ -407,10 +407,9 @@ grub_puts (const char *s)
 int EXPORT_FUNC(grub_puts_) (const char *s);
 int EXPORT_FUNC(grub_debug_enabled) (const char *condition);
 void EXPORT_FUNC(grub_real_dprintf) (const char *file,
-				     const char *function,
                                      const int line,
                                      const char *condition,
-                                     const char *fmt, ...) __attribute__ ((format (GNU_PRINTF, 5, 6)));
+                                     const char *fmt, ...) __attribute__ ((format (GNU_PRINTF, 4, 5)));
 int EXPORT_FUNC(grub_printf) (const char *fmt, ...) __attribute__ ((format (GNU_PRINTF, 1, 2)));
 int EXPORT_FUNC(grub_printf_) (const char *fmt, ...) __attribute__ ((format (GNU_PRINTF, 1, 2)));
 int EXPORT_FUNC(grub_vprintf) (const char *fmt, va_list args);