Revert "qht: constify qht_statistics_init"
This reverts commit 6579f10779.
This change partially addresses https://bugs.launchpad.net/qemu/+bug/1886155
where a pre-release gcc 11 warns about const qualifier abuse.
Signed-off-by: Bruce Rogers <brogers@suse.com>
			
			
This commit is contained in:
		| @@ -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(). |  * When done with @stats, pass the struct to qht_statistics_destroy(). | ||||||
|  * Failing to do this will leak memory. |  * Failing to do this will leak memory. | ||||||
|  */ |  */ | ||||||
| void qht_statistics_init(const struct qht *ht, struct qht_stats *stats); | void qht_statistics_init(struct qht *ht, struct qht_stats *stats); | ||||||
|  |  | ||||||
| /** | /** | ||||||
|  * qht_statistics_destroy - Destroy a &struct qht_stats |  * qht_statistics_destroy - Destroy a &struct qht_stats | ||||||
|   | |||||||
| @@ -901,9 +901,9 @@ bool qht_resize(struct qht *ht, size_t n_elems) | |||||||
| } | } | ||||||
|  |  | ||||||
| /* pass @stats to qht_statistics_destroy() when done */ | /* pass @stats to qht_statistics_destroy() when done */ | ||||||
| void qht_statistics_init(const struct qht *ht, struct qht_stats *stats) | void qht_statistics_init(struct qht *ht, struct qht_stats *stats) | ||||||
| { | { | ||||||
|     const struct qht_map *map; |     struct qht_map *map; | ||||||
|     int i; |     int i; | ||||||
|  |  | ||||||
|     map = qatomic_rcu_read(&ht->map); |     map = qatomic_rcu_read(&ht->map); | ||||||
| @@ -920,8 +920,8 @@ void qht_statistics_init(const struct qht *ht, struct qht_stats *stats) | |||||||
|     stats->head_buckets = map->n_buckets; |     stats->head_buckets = map->n_buckets; | ||||||
|  |  | ||||||
|     for (i = 0; i < map->n_buckets; i++) { |     for (i = 0; i < map->n_buckets; i++) { | ||||||
|         const struct qht_bucket *head = &map->buckets[i]; |         struct qht_bucket *head = &map->buckets[i]; | ||||||
|         const struct qht_bucket *b; |         struct qht_bucket *b; | ||||||
|         unsigned int version; |         unsigned int version; | ||||||
|         size_t buckets; |         size_t buckets; | ||||||
|         size_t entries; |         size_t entries; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user