]> git.ipfire.org Git - thirdparty/collectd.git/commitdiff
rest of plugins: __FUNCTION__ -> __func__ (C99)
authorEero Tamminen <eero.t.tamminen@intel.com>
Tue, 30 Jan 2024 10:42:42 +0000 (12:42 +0200)
committerEero Tamminen <eero.t.tamminen@intel.com>
Tue, 30 Jan 2024 10:42:42 +0000 (12:42 +0200)
Fixes -Wpendantic warnings in rest of plugins.

Signed-off-by: Eero Tamminen <eero.t.tamminen@intel.com>
src/dcpmm.c
src/intel_pmu.c
src/ipmi.c
src/mcelog.c
src/mdevents.c

index cf8292f7f45390baf2143cdba5b02c8d5b287588..608cb6eaae4b149352bddf7ba6653b1b5f8466dc 100644 (file)
@@ -90,7 +90,7 @@ static void add_metric(const char *plugin_inst, const char *type,
 } /* void add_metric  */
 
 static int dcpmm_read(__attribute__((unused)) user_data_t *ud) {
-  DEBUG(PLUGIN_NAME ": %s:%d", __FUNCTION__, __LINE__);
+  DEBUG(PLUGIN_NAME ": %s:%d", __func__, __LINE__);
 
   int i, ret = 0;
   char dimm_num[16];
@@ -167,12 +167,12 @@ static int dcpmm_read(__attribute__((unused)) user_data_t *ud) {
 } /* int dcpmm_read */
 
 static int dcpmm_stop(void) {
-  DEBUG(PLUGIN_NAME ": %s:%d", __FUNCTION__, __LINE__);
+  DEBUG(PLUGIN_NAME ": %s:%d", __func__, __LINE__);
 
   int ret = 0;
 
   if (skip_stop) {
-    DEBUG(PLUGIN_NAME ": %s:%d skipping stop function", __FUNCTION__, __LINE__);
+    DEBUG(PLUGIN_NAME ": %s:%d skipping stop function", __func__, __LINE__);
 
     return ret;
   }
@@ -186,7 +186,7 @@ static int dcpmm_stop(void) {
 } /* int dcpmm_stop */
 
 static int dcpmm_shutdown(void) {
-  DEBUG(PLUGIN_NAME ": %s:%d", __FUNCTION__, __LINE__);
+  DEBUG(PLUGIN_NAME ": %s:%d", __func__, __LINE__);
 
   int ret = 0;
 
@@ -198,7 +198,7 @@ static int dcpmm_shutdown(void) {
 } /* int dcpmm_shutdown */
 
 static int dcpmm_init(void) {
-  DEBUG(PLUGIN_NAME ": %s:%d", __FUNCTION__, __LINE__);
+  DEBUG(PLUGIN_NAME ": %s:%d", __func__, __LINE__);
 
   int ret = 0;
 
@@ -239,7 +239,7 @@ static int dcpmm_init(void) {
 } /* int dcpmm_init */
 
 static int dcpmm_config(oconfig_item_t *ci) {
-  DEBUG(PLUGIN_NAME ": %s:%d", __FUNCTION__, __LINE__);
+  DEBUG(PLUGIN_NAME ": %s:%d", __func__, __LINE__);
 
   int ret = 0;
 
index a30cbe511e92b22fbd662c76e391e643d75d880d..622eb6b7d5b7ca7a48e7a96ef4afc3f2db80f376 100644 (file)
@@ -215,7 +215,7 @@ static int pmu_config_hw_events(oconfig_item_t *ci, intel_pmu_entity_t *ent) {
 
 static int pmu_config(oconfig_item_t *ci) {
 
-  DEBUG(PMU_PLUGIN ": %s:%d", __FUNCTION__, __LINE__);
+  DEBUG(PMU_PLUGIN ": %s:%d", __func__, __LINE__);
 
   for (int i = 0; i < ci->children_num; i++) {
     int ret = 0;
@@ -257,7 +257,7 @@ static int pmu_config(oconfig_item_t *ci) {
     }
 
     if (ret != 0) {
-      DEBUG(PMU_PLUGIN ": %s:%d ret=%d", __FUNCTION__, __LINE__, ret);
+      DEBUG(PMU_PLUGIN ": %s:%d ret=%d", __func__, __LINE__, ret);
       return ret;
     }
   }
@@ -427,18 +427,18 @@ static void pmu_dispatch_data(intel_pmu_entity_t *ent) {
 
 static int pmu_read(user_data_t *ud) {
   if (ud == NULL) {
-    ERROR(PMU_PLUGIN ": ud is NULL! %s:%d", __FUNCTION__, __LINE__);
+    ERROR(PMU_PLUGIN ": ud is NULL! %s:%d", __func__, __LINE__);
     return -1;
   }
   if (ud->data == NULL) {
-    ERROR(PMU_PLUGIN ": ud->data is NULL! %s:%d", __FUNCTION__, __LINE__);
+    ERROR(PMU_PLUGIN ": ud->data is NULL! %s:%d", __func__, __LINE__);
     return -1;
   }
   intel_pmu_entity_t *ent = (intel_pmu_entity_t *)ud->data;
   int ret;
   struct event *e;
 
-  DEBUG(PMU_PLUGIN ": %s:%d", __FUNCTION__, __LINE__);
+  DEBUG(PMU_PLUGIN ": %s:%d", __func__, __LINE__);
 
   /* read all events only for configured cores */
   for (e = ent->event_list->eventlist; e; e = e->next) {
@@ -703,7 +703,7 @@ static int pmu_read_all_events(void *data, char *name, char *event,
 static int pmu_init(void) {
   int ret;
 
-  DEBUG(PMU_PLUGIN ": %s:%d", __FUNCTION__, __LINE__);
+  DEBUG(PMU_PLUGIN ": %s:%d", __func__, __LINE__);
 
   if (g_ctx.entl == NULL) {
     ERROR(PMU_PLUGIN ": No events were setup in configuration.");
@@ -861,7 +861,7 @@ init_error:
 
 static int pmu_shutdown(void) {
 
-  DEBUG(PMU_PLUGIN ": %s:%d", __FUNCTION__, __LINE__);
+  DEBUG(PMU_PLUGIN ": %s:%d", __func__, __LINE__);
 
   for (intel_pmu_entity_t *ent = g_ctx.entl; ent != NULL;) {
     intel_pmu_entity_t *tmp = ent;
index 6e3db951a3631827346afdbaa1affdf22ea942eb..a3d92b2289067d29a867da9f675375b9bae9b29b 100644 (file)
@@ -859,7 +859,7 @@ static void smi_event_handler(ipmi_con_t __attribute__((unused)) * ipmi,
   unsigned int type = ipmi_event_get_type(event);
   ipmi_domain_t *domain = cb_data;
 
-  DEBUG("%s: Event received: type %u", __FUNCTION__, type);
+  DEBUG("%s: Event received: type %u", __func__, type);
 
   if (type != 0x02)
     /* It's not a standard IPMI event. */
index f362b1a28b54599ba626722800e2162e761bcd80..c520251cf903ec586d0d647ad09fa9fed1d86dc3 100644 (file)
@@ -264,7 +264,7 @@ static int socket_write(socket_adapter_t *self, const char *msg,
 
 static void mcelog_dispatch_notification(notification_t *n) {
   if (!n) {
-    ERROR(MCELOG_PLUGIN ": %s: NULL pointer", __FUNCTION__);
+    ERROR(MCELOG_PLUGIN ": %s: NULL pointer", __func__);
     return;
   }
 
@@ -401,7 +401,7 @@ static int mcelog_dispatch_mem_notifications(const mcelog_memory_rec_t *mr) {
 static int mcelog_submit(const mcelog_memory_rec_t *mr) {
 
   if (!mr) {
-    ERROR(MCELOG_PLUGIN ": %s: NULL pointer", __FUNCTION__);
+    ERROR(MCELOG_PLUGIN ": %s: NULL pointer", __func__);
     return -1;
   }
 
@@ -656,7 +656,7 @@ static int get_memory_machine_checks(void) {
 }
 
 static int mcelog_read(__attribute__((unused)) user_data_t *ud) {
-  DEBUG(MCELOG_PLUGIN ": %s", __FUNCTION__);
+  DEBUG(MCELOG_PLUGIN ": %s", __func__);
 
   if (get_memory_machine_checks() != 0)
     ERROR(MCELOG_PLUGIN ": MACHINE CHECK INFO NOT AVAILABLE");
index 7cbfb0a18b38efcf8753b3cef9ecffeda289c20d..d6b80b35dc534636380836cb6f5fa5b93136c1b7 100644 (file)
@@ -41,7 +41,7 @@
 #define DAEMON_NAME "mdadm"
 
 #define MD_EVENTS_ERROR(err_msg, ...)                                          \
-  ERROR(MD_EVENTS_PLUGIN ": %s: " err_msg, __FUNCTION__, ##__VA_ARGS__)
+  ERROR(MD_EVENTS_PLUGIN ": %s: " err_msg, __func__, ##__VA_ARGS__)
 
 // Syslog can be located under different paths on various linux distros;
 // The following two cover the debian-based and redhat distros