Skip to contentSkip to conversation

xen/common: Replace __FUNCTION__ with __func__

PATCH In review Andrew Cooper 3 participants 3 messages Feb 3, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xen/common: Replace __FUNCTION__ with __func__

__func__ is standard C99, whereas __FUNCTION__ is a GCCism.

No functional change.

---
CC: George Dunlap <[email protected]>
CC: Jan Beulich <[email protected]>
CC: Konrad Rzeszutek Wilk <[email protected]>
CC: Stefano Stabellini <[email protected]>
CC: Tim Deegan <[email protected]>
CC: Wei Liu <[email protected]>

---
 xen/common/grant_table.c          | 4 ++--
 xen/common/libelf/libelf-loader.c | 4 ++--
 xen/common/wait.c                 | 2 +-
 xen/include/acpi/platform/acgcc.h | 2 +-
 4 files changed, 6 insertions(+), 6 deletions(-)
xen/common/grant_table.c +2 -2
index a425a9e..04058dd 100644
@@ -3547,10 +3547,10 @@ static void gnttab_usage_print(struct domain *rd)
 static void gnttab_usage_print_all(unsigned char key)
 {
     struct domain *d;
-    printk("%s [ key '%c' pressed\n", __FUNCTION__, key);
+    printk("%s [ key '%c' pressed\n", __func__, key);
     for_each_domain ( d )
         gnttab_usage_print(d);
-    printk("%s ] done\n", __FUNCTION__);
+    printk("%s ] done\n", __func__);
 }
 
 static int __init gnttab_usage_init(void)
xen/common/libelf/libelf-loader.c +2 -2
index a72cd8a..1644f16 100644
@@ -536,12 +536,12 @@ uint64_t elf_lookup_addr(struct elf_binary * elf, const char *symbol)
     sym = elf_sym_by_name(elf, symbol);
     if ( !ELF_HANDLE_VALID(sym) )
     {
-        elf_err(elf, "%s: not found: %s\n", __FUNCTION__, symbol);
+        elf_err(elf, "%s: not found: %s\n", __func__, symbol);
         return -1;
     }
 
     value = elf_uval(elf, sym, st_value);
-    elf_msg(elf, "%s: symbol \"%s\" at 0x%" PRIx64 "\n", __FUNCTION__,
+    elf_msg(elf, "%s: symbol \"%s\" at 0x%" PRIx64 "\n", __func__,
             symbol, value);
     return value;
 }
xen/common/wait.c +1 -1
index 4ac98c0..89cfc06 100644
@@ -155,7 +155,7 @@ static void __prepare_to_wait(struct waitqueue_vcpu *wqv)
 
     if ( unlikely(wqv->esp == 0) )
     {
-        gdprintk(XENLOG_ERR, "Stack too large in %s\n", __FUNCTION__);
+        gdprintk(XENLOG_ERR, "Stack too large in %s\n", __func__);
         domain_crash_synchronous();
     }
 
xen/include/acpi/platform/acgcc.h +1 -1
index 3bb5049..b355e98 100644
@@ -46,7 +46,7 @@
 
 /* Function name is used for debug output. Non-ANSI, compiler-dependent */
 
-#define ACPI_GET_FUNCTION_NAME          __FUNCTION__
+#define ACPI_GET_FUNCTION_NAME          __func__
 
 /*
  * This macro is used to tag functions as "printf-like" because
Signature · 7 lines
2.1.4


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines · Andrew Cooper

__func__ is standard C99, whereas __FUNCTION__ is a GCCism.

No functional change.

Quoted 78 lines
CC George Dunlap <[email protected]>
CC Jan Beulich <[email protected]>
CC Konrad Rzeszutek Wilk <[email protected]>
CC Stefano Stabellini <[email protected]>
CC Tim Deegan <[email protected]>
CC Wei Liu <[email protected]>
---
 xen/common/grant_table.c          | 4 ++--
 xen/common/libelf/libelf-loader.c | 4 ++--
 xen/common/wait.c                 | 2 +-
 xen/include/acpi/platform/acgcc.h | 2 +-
 4 files changed, 6 insertions(+), 6 deletions(-)
xen/common/grant_table.c +2 -2
index a425a9e..04058dd 100644
@@ -3547,10 +3547,10 @@ static void gnttab_usage_print(struct domain *rd)
 static void gnttab_usage_print_all(unsigned char key)
 {
     struct domain *d;
-    printk("%s [ key '%c' pressed\n", __FUNCTION__, key);
+    printk("%s [ key '%c' pressed\n", __func__, key);
     for_each_domain ( d )
         gnttab_usage_print(d);
-    printk("%s ] done\n", __FUNCTION__);
+    printk("%s ] done\n", __func__);
 }
 
 static int __init gnttab_usage_init(void)
xen/common/libelf/libelf-loader.c +2 -2
index a72cd8a..1644f16 100644
@@ -536,12 +536,12 @@ uint64_t elf_lookup_addr(struct elf_binary * elf, const char *symbol)
     sym = elf_sym_by_name(elf, symbol);
     if ( !ELF_HANDLE_VALID(sym) )
     {
-        elf_err(elf, "%s: not found: %s\n", __FUNCTION__, symbol);
+        elf_err(elf, "%s: not found: %s\n", __func__, symbol);
         return -1;
     }
 
     value = elf_uval(elf, sym, st_value);
-    elf_msg(elf, "%s: symbol \"%s\" at 0x%" PRIx64 "\n", __FUNCTION__,
+    elf_msg(elf, "%s: symbol \"%s\" at 0x%" PRIx64 "\n", __func__,
             symbol, value);
     return value;
 }
xen/common/wait.c +1 -1
index 4ac98c0..89cfc06 100644
@@ -155,7 +155,7 @@ static void __prepare_to_wait(struct waitqueue_vcpu *wqv)
 
     if ( unlikely(wqv->esp == 0) )
     {
-        gdprintk(XENLOG_ERR, "Stack too large in %s\n", __FUNCTION__);
+        gdprintk(XENLOG_ERR, "Stack too large in %s\n", __func__);
         domain_crash_synchronous();
     }
 
xen/include/acpi/platform/acgcc.h +1 -1
index 3bb5049..b355e98 100644
@@ -46,7 +46,7 @@
 
 /* Function name is used for debug output. Non-ANSI, compiler-dependent */
 
-#define ACPI_GET_FUNCTION_NAME          __FUNCTION__
+#define ACPI_GET_FUNCTION_NAME          __func__
 
 /*
  * This macro is used to tag functions as "printf-like" because
Signature · 1 line
2.1.4

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel