]> xenbits.xensource.com Git - qemu-xen.git/commitdiff
qht: constify qht_statistics_init
authorEmilio G. Cota <cota@braap.org>
Mon, 10 Sep 2018 17:43:06 +0000 (13:43 -0400)
committerRichard Henderson <richard.henderson@linaro.org>
Wed, 26 Sep 2018 15:55:54 +0000 (08:55 -0700)
Signed-off-by: Emilio G. Cota <cota@braap.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
include/qemu/qht.h
util/qht.c

index 2e2d6bca932c83bea993850b60f8e6cab8784cbe..758c7ac6c89978ee762e9d94658471cc22b6aabc 100644 (file)
@@ -211,7 +211,7 @@ void qht_iter_remove(struct qht *ht, qht_iter_bool_func_t func, void *userp);
  * When done with @stats, pass the struct to qht_statistics_destroy().
  * Failing to do this will leak memory.
  */
-void qht_statistics_init(struct qht *ht, struct qht_stats *stats);
+void qht_statistics_init(const struct qht *ht, struct qht_stats *stats);
 
 /**
  * qht_statistics_destroy - Destroy a &struct qht_stats
index 020dfe69129ddf0e75299e620948e2adfcf97613..4378775d68068462847566b38e8b2fb61ae42f4d 100644 (file)
@@ -895,9 +895,9 @@ bool qht_resize(struct qht *ht, size_t n_elems)
 }
 
 /* pass @stats to qht_statistics_destroy() when done */
-void qht_statistics_init(struct qht *ht, struct qht_stats *stats)
+void qht_statistics_init(const struct qht *ht, struct qht_stats *stats)
 {
-    struct qht_map *map;
+    const struct qht_map *map;
     int i;
 
     map = atomic_rcu_read(&ht->map);
@@ -914,8 +914,8 @@ void qht_statistics_init(struct qht *ht, struct qht_stats *stats)
     stats->head_buckets = map->n_buckets;
 
     for (i = 0; i < map->n_buckets; i++) {
-        struct qht_bucket *head = &map->buckets[i];
-        struct qht_bucket *b;
+        const struct qht_bucket *head = &map->buckets[i];
+        const struct qht_bucket *b;
         unsigned int version;
         size_t buckets;
         size_t entries;