From: Pankaj Gupta <pagupta@redhat.com>
To: Wei Jiangang <weijg.fnst@cn.fujitsu.com>
Cc: amit shah <amit.shah@redhat.com>,
aliguori@us.ibm.com, qemu-devel@nongnu.org, mst@redhat.com
Subject: Re: [Qemu-devel] [PATCH] rng-random: rename RndRandom to RngRandom
Date: Fri, 29 Apr 2016 03:34:06 -0400 (EDT) [thread overview]
Message-ID: <1267385831.47277205.1461915246870.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <1460684168-5403-1-git-send-email-weijg.fnst@cn.fujitsu.com>
Code changes look fine to me.
>
> Usually, Random Number Generator is abbreviated to RNG/rng.
> so replacing RndRandom with RngRandom seems more reasonable
> and keep consistent with RngBackend.
Reviewed-by: Pankaj Gupta <pagupta@redhat.com>
>
> Signed-off-by: Wei Jiangang <weijg.fnst@cn.fujitsu.com>
> ---
> 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
> --
> 1.9.3
>
>
>
>
>
prev parent reply other threads:[~2016-04-29 9:14 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-15 1:36 [Qemu-devel] [PATCH] rng-random: rename RndRandom to RngRandom Wei Jiangang
2016-04-15 1:39 ` Wei, Jiangang
2016-04-29 7:34 ` Pankaj Gupta [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1267385831.47277205.1461915246870.JavaMail.zimbra@redhat.com \
--to=pagupta@redhat.com \
--cc=aliguori@us.ibm.com \
--cc=amit.shah@redhat.com \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=weijg.fnst@cn.fujitsu.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).