Merge branch 'collectd-5.6' into collectd-5.7
[collectd.git] / src / lpar.c
index 412a721..df4424c 100644 (file)
@@ -99,18 +99,13 @@ static int lpar_init(void) {
 } /* int lpar_init */
 
 static void lpar_submit(const char *type_instance, double value) {
-  value_t values[1];
   value_list_t vl = VALUE_LIST_INIT;
 
-  values[0].gauge = (gauge_t)value;
-
-  vl.values = values;
+  vl.values = &(value_t){.gauge = value};
   vl.values_len = 1;
   if (report_by_serial) {
     sstrncpy(vl.host, serial, sizeof(vl.host));
     sstrncpy(vl.plugin_instance, hostname_g, sizeof(vl.plugin));
-  } else {
-    sstrncpy(vl.host, hostname_g, sizeof(vl.host));
   }
   sstrncpy(vl.plugin, "lpar", sizeof(vl.plugin));
   sstrncpy(vl.type, "vcpu", sizeof(vl.type));