From patchwork Wed Sep 26 18:37:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 147639 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp1071781lji; Wed, 26 Sep 2018 11:43:33 -0700 (PDT) X-Google-Smtp-Source: ACcGV60OhTW3Sqyx32X4kTBCsnB0bBwIqpVqojQcAwXL2IXekj5/YVLkS7rd+ECvxriTms/3VyjB X-Received: by 2002:a0c:e3d0:: with SMTP id e16-v6mr3855279qvl.243.1537987413883; Wed, 26 Sep 2018 11:43:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537987413; cv=none; d=google.com; s=arc-20160816; b=W+BopEYVYBhSmaSiEV44KO2hLEMaurzucmPb9hQG5bRfBc4lriXGcb0bG2UHBN6DEy ydkYyj6AF0YICIRHTebS1nAWb1RIZQ0E5fFvN9sbvDBrMkLCHDJUyPFuVpy0XpEtKH3w iD6KJIw6q3jC8+1jQzeElQgGx2MTMbVRf2DjZ7Vb0rRSR0Gbkh2CvTWQpyddEKwcuxiV Q59mlNfmok7ebovB5noVCJBVjw4fPD7eqf7BhdGs3nRSoVqW7UT3e+ImoBkfLdHh7IJz t93unMBW23DdVFZLzTNs4u3Xnb2d6xAyYDGPva0vCBXXq5NAethwKZWE5DHqvJSMqYx1 LJdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=2f+ugjPHLeSDiiV6/XWDzcoxvvv3dDlF86QnrCsUJ/k=; b=FnO7OOhxk/Si2hFx7yy2wMZLyr3EnTDS5M8NRQE5Xc+WODPwQqsc3lkJdescRq/7v7 6pyD4tdybCeXPtvIOTHpzl7ojTaTCVHmWoHUeZI48k9k/kiWI1uxWfNBl9VZYh1bPjMW 2dcyauOHsMTjjdi3br8mOYsJBVehEq8pBHWhgnh8gGCoIqdhWg1+csXmGDE9gEE23vzW oA+/MrV0m4FBvYNYKbgBSO3YjCQQHKz7Ge5jtq78XaJ35TXVCD5q9viXog/Q6hNaCX9L m3JiyHpAw/f7cqxdLi8BfFlwh+ryChm9uj3sR6W3gExi3EL397VE1MKCeuEuifNCEP55 SVDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=B+vSnhvD; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id d8-v6si2335541qtg.271.2018.09.26.11.43.33 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 26 Sep 2018 11:43:33 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=B+vSnhvD; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:60194 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g5Ema-00089f-N3 for patch@linaro.org; Wed, 26 Sep 2018 14:43:32 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53603) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g5Egm-0001b7-Fw for qemu-devel@nongnu.org; Wed, 26 Sep 2018 14:37:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g5Egk-0007P1-8w for qemu-devel@nongnu.org; Wed, 26 Sep 2018 14:37:32 -0400 Received: from mail-pg1-x52e.google.com ([2607:f8b0:4864:20::52e]:46887) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1g5Egj-0007Np-UQ for qemu-devel@nongnu.org; Wed, 26 Sep 2018 14:37:30 -0400 Received: by mail-pg1-x52e.google.com with SMTP id b129-v6so14389290pga.13 for ; Wed, 26 Sep 2018 11:37:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=2f+ugjPHLeSDiiV6/XWDzcoxvvv3dDlF86QnrCsUJ/k=; b=B+vSnhvDxrIswzM9anfSrZi4PwRbyjNkYEHn2hYsnmgatP8ECngmkXm8yzvqrG+2Sf BKfPNkj3woTdXUWTfJSVFIr/WUYffT7z3UTze2fHmiY7OHrYSdS5cBCpS5zB2yFXdkwT njWK4UNveXr6qmuZ5y4dwizPTldnQWf7YFeA0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=2f+ugjPHLeSDiiV6/XWDzcoxvvv3dDlF86QnrCsUJ/k=; b=NcNTURRYo7JdQXXUMjEIymlbu0Yw/gmVEbw7TQk7NOsDITI8V30Og1NdaZMiAxNmwX icjv4p3v0jVwtVtuk7InkjtA4H9najgmMA8mJEIVcYX17lTCodomtweFhDZi0ObD2fu1 0YVMeLqq1TOINEEOtlu3tphdegm34fboC/zSe/oHUgLKZIij6d9vHgok28pvtXlY3dzJ nkbNcOIsfyqr8PNg/Gr1PtwAaFTSvpQCzs3TQqZo9M7sfeFWc44e0OQDn80ZWm70NvMQ 7FryLa8hXskqeLvcl5sfVCvYlEVk7qTswOTeHpToaCDllSVoMxiU8K0s9hqrK8laFcLf rH8A== X-Gm-Message-State: ABuFfohTACXR4geKNpd7E1bZktnvlTdVLUBDdz9NIqEaBYmuPFjWRPnd p2K3NBrA3NRsgtEumhKumjJG3LczRjM= X-Received: by 2002:a63:7b09:: with SMTP id w9-v6mr6926880pgc.385.1537987047747; Wed, 26 Sep 2018 11:37:27 -0700 (PDT) Received: from cloudburst.twiddle.net (97-113-8-179.tukw.qwest.net. [97.113.8.179]) by smtp.gmail.com with ESMTPSA id b14-v6sm9735952pfc.178.2018.09.26.11.37.26 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 26 Sep 2018 11:37:26 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Wed, 26 Sep 2018 11:37:06 -0700 Message-Id: <20180926183709.21293-11-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180926183709.21293-1-richard.henderson@linaro.org> References: <20180926183709.21293-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::52e Subject: [Qemu-devel] [PULL 10/13] qht: constify qht_statistics_init X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, "Emilio G. Cota" Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" Signed-off-by: Emilio G. Cota Signed-off-by: Richard Henderson --- include/qemu/qht.h | 2 +- util/qht.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) -- 2.17.1 diff --git a/include/qemu/qht.h b/include/qemu/qht.h index 2e2d6bca93..758c7ac6c8 100644 --- a/include/qemu/qht.h +++ b/include/qemu/qht.h @@ -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 diff --git a/util/qht.c b/util/qht.c index 020dfe6912..4378775d68 100644 --- a/util/qht.c +++ b/util/qht.c @@ -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;