]> git.ipfire.org Git - thirdparty/collectd.git/commitdiff
Attribute unused function args as such in few of the plugins
authorEero Tamminen <eero.t.tamminen@intel.com>
Fri, 4 Feb 2022 10:20:27 +0000 (12:20 +0200)
committerEero Tamminen <eero.t.tamminen@intel.com>
Tue, 16 Jan 2024 13:03:00 +0000 (15:03 +0200)
Based on "-O3 -Werror -Wall -Wextra -Wformat-security" output.

src/cgroups.c
src/conntrack.c
src/statsd.c
src/turbostat.c

index 8925239848f0ba2af42d50e92b6a5224fc050540..2831253f714aef57eaeb81e751b8075c68ad57ef 100644 (file)
@@ -52,7 +52,7 @@ cgroups_submit_one(char const *plugin_instance, char const *type_instance,
  * This callback reads the user/system CPU time for each cgroup.
  */
 static int read_cpuacct_procs(const char *dirname, char const *cgroup_name,
-                              void *user_data) {
+                              __attribute__((unused)) void *user_data) {
   char abs_path[PATH_MAX];
   struct stat statbuf;
   char buf[1024];
@@ -131,7 +131,7 @@ static int read_cpuacct_procs(const char *dirname, char const *cgroup_name,
  * read_cpuacct_procs callback on every folder it finds, such as "system".
  */
 static int read_cpuacct_root(const char *dirname, const char *filename,
-                             void *user_data) {
+                             __attribute__((unused)) void *user_data) {
   char abs_path[PATH_MAX];
   struct stat statbuf;
   int status;
index 7b61eef0814647df272bde241244f9468164716d..867b3cb6c1733e50649998a01324cdf540923e75 100644 (file)
@@ -43,7 +43,8 @@ static int config_keys_num = STATIC_ARRAY_SIZE(config_keys);
 
 static int old_files;
 
-static int conntrack_config(const char *key, const char *value) {
+static int conntrack_config(const char *key,
+                            __attribute__((unused)) const char *value) {
   if (strcmp(key, "OldFiles") == 0)
     old_files = 1;
 
index 3d852ccdeac68dcf4211fb5ec5f1b317b563f565..5612737b129d957099f4e6432b5bc0643858961f 100644 (file)
@@ -550,7 +550,7 @@ static int statsd_network_init(struct pollfd **ret_fds, /* {{{ */
   return 0;
 } /* }}} int statsd_network_init */
 
-static void *statsd_network_thread(void *args) /* {{{ */
+static void *statsd_network_thread(__attribute__((unused)) void *args) /* {{{ */
 {
   struct pollfd *fds = NULL;
   size_t fds_num = 0;
index 8bbb92b552241a4faf40e4f880444cdbb2fe7534..27a04655bbac6d18dff38b23443ed124547672db 100644 (file)
@@ -835,7 +835,8 @@ for_all_cpus_delta(const struct thread_data *thread_new_base,
  * Package Thermal Management Sensor (PTM), and thermal event thresholds.
  */
 static int __attribute__((warn_unused_result))
-set_temperature_target(struct thread_data *t, struct core_data *c,
+set_temperature_target(struct thread_data *t,
+                       __attribute__((unused)) struct core_data *c,
                        struct pkg_data *p) {
   unsigned long long msr;
   unsigned int target_c_local;