From patchwork Fri Apr 15 01:36:08 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Jiangang X-Patchwork-Id: 8844261 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id DBD2BC0553 for ; Fri, 15 Apr 2016 01:37:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 210D7202F0 for ; Fri, 15 Apr 2016 01:37:18 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2FDBD202EB for ; Fri, 15 Apr 2016 01:37:17 +0000 (UTC) Received: from localhost ([::1]:51291 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aqshA-0005wb-4o for patchwork-qemu-devel@patchwork.kernel.org; Thu, 14 Apr 2016 21:37:16 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37751) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aqsh2-0005tH-27 for qemu-devel@nongnu.org; Thu, 14 Apr 2016 21:37:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aqsgy-0007rO-0O for qemu-devel@nongnu.org; Thu, 14 Apr 2016 21:37:07 -0400 Received: from [59.151.112.132] (port=44884 helo=heian.cn.fujitsu.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aqsgu-0007cA-U9 for qemu-devel@nongnu.org; Thu, 14 Apr 2016 21:37:03 -0400 X-IronPort-AV: E=Sophos;i="5.22,518,1449504000"; d="scan'208";a="5619675" Received: from unknown (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 15 Apr 2016 09:36:48 +0800 Received: from G08CNEXCHPEKD01.g08.fujitsu.local (unknown [10.167.33.80]) by cn.fujitsu.com (Postfix) with ESMTP id 1D05D42B55E4; Fri, 15 Apr 2016 09:36:46 +0800 (CST) Received: from localhost.localdomain (10.167.226.50) by G08CNEXCHPEKD01.g08.fujitsu.local (10.167.33.89) with Microsoft SMTP Server (TLS) id 14.3.279.2; Fri, 15 Apr 2016 09:36:45 +0800 From: Wei Jiangang To: Date: Fri, 15 Apr 2016 09:36:08 +0800 Message-ID: <1460684168-5403-1-git-send-email-weijg.fnst@cn.fujitsu.com> X-Mailer: git-send-email 1.9.3 MIME-Version: 1.0 X-Originating-IP: [10.167.226.50] X-yoursite-MailScanner-ID: 1D05D42B55E4.AD49D X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: weijg.fnst@cn.fujitsu.com X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 59.151.112.132 Subject: [Qemu-devel] [PATCH] rng-random: rename RndRandom to RngRandom 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: aliguori@us.ibm.com, Wei Jiangang , qemu-devel@nongnu.org, mst@redhat.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Usually, Random Number Generator is abbreviated to RNG/rng. so replacing RndRandom with RngRandom seems more reasonable and keep consistent with RngBackend. Signed-off-by: Wei Jiangang Reviewed-by: Pankaj Gupta --- backends/rng-random.c | 18 +++++++++--------- include/hw/virtio/virtio-rng.h | 2 +- include/sysemu/rng-random.h | 4 ++-- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/backends/rng-random.c b/backends/rng-random.c index 2e44e25..e2a49b0 100644 --- a/backends/rng-random.c +++ b/backends/rng-random.c @@ -17,7 +17,7 @@ #include "qapi/qmp/qerror.h" #include "qemu/main-loop.h" -struct RndRandom +struct RngRandom { RngBackend parent; @@ -34,7 +34,7 @@ struct RndRandom static void entropy_available(void *opaque) { - RndRandom *s = RNG_RANDOM(opaque); + RngRandom *s = RNG_RANDOM(opaque); while (!QSIMPLEQ_EMPTY(&s->parent.requests)) { RngRequest *req = QSIMPLEQ_FIRST(&s->parent.requests); @@ -57,7 +57,7 @@ static void entropy_available(void *opaque) static void rng_random_request_entropy(RngBackend *b, RngRequest *req) { - RndRandom *s = RNG_RANDOM(b); + RngRandom *s = RNG_RANDOM(b); if (QSIMPLEQ_EMPTY(&s->parent.requests)) { /* If there are no pending requests yet, we need to @@ -68,7 +68,7 @@ static void rng_random_request_entropy(RngBackend *b, RngRequest *req) static void rng_random_opened(RngBackend *b, Error **errp) { - RndRandom *s = RNG_RANDOM(b); + RngRandom *s = RNG_RANDOM(b); if (s->filename == NULL) { error_setg(errp, QERR_INVALID_PARAMETER_VALUE, @@ -83,7 +83,7 @@ static void rng_random_opened(RngBackend *b, Error **errp) static char *rng_random_get_filename(Object *obj, Error **errp) { - RndRandom *s = RNG_RANDOM(obj); + RngRandom *s = RNG_RANDOM(obj); return g_strdup(s->filename); } @@ -92,7 +92,7 @@ static void rng_random_set_filename(Object *obj, const char *filename, Error **errp) { RngBackend *b = RNG_BACKEND(obj); - RndRandom *s = RNG_RANDOM(obj); + RngRandom *s = RNG_RANDOM(obj); if (b->opened) { error_setg(errp, QERR_PERMISSION_DENIED); @@ -105,7 +105,7 @@ static void rng_random_set_filename(Object *obj, const char *filename, static void rng_random_init(Object *obj) { - RndRandom *s = RNG_RANDOM(obj); + RngRandom *s = RNG_RANDOM(obj); object_property_add_str(obj, "filename", rng_random_get_filename, @@ -118,7 +118,7 @@ static void rng_random_init(Object *obj) static void rng_random_finalize(Object *obj) { - RndRandom *s = RNG_RANDOM(obj); + RngRandom *s = RNG_RANDOM(obj); if (s->fd != -1) { qemu_set_fd_handler(s->fd, NULL, NULL, NULL); @@ -139,7 +139,7 @@ static void rng_random_class_init(ObjectClass *klass, void *data) static const TypeInfo rng_random_info = { .name = TYPE_RNG_RANDOM, .parent = TYPE_RNG_BACKEND, - .instance_size = sizeof(RndRandom), + .instance_size = sizeof(RngRandom), .class_init = rng_random_class_init, .instance_init = rng_random_init, .instance_finalize = rng_random_finalize, diff --git a/include/hw/virtio/virtio-rng.h b/include/hw/virtio/virtio-rng.h index 3f07de7..2bc1ee5 100644 --- a/include/hw/virtio/virtio-rng.h +++ b/include/hw/virtio/virtio-rng.h @@ -26,7 +26,7 @@ struct VirtIORNGConf { RngBackend *rng; uint64_t max_bytes; uint32_t period_ms; - RndRandom *default_backend; + RngRandom *default_backend; }; typedef struct VirtIORNG { diff --git a/include/sysemu/rng-random.h b/include/sysemu/rng-random.h index 4332772..38186fe 100644 --- a/include/sysemu/rng-random.h +++ b/include/sysemu/rng-random.h @@ -15,8 +15,8 @@ #include "qom/object.h" #define TYPE_RNG_RANDOM "rng-random" -#define RNG_RANDOM(obj) OBJECT_CHECK(RndRandom, (obj), TYPE_RNG_RANDOM) +#define RNG_RANDOM(obj) OBJECT_CHECK(RngRandom, (obj), TYPE_RNG_RANDOM) -typedef struct RndRandom RndRandom; +typedef struct RngRandom RngRandom; #endif