From: Bruce Richardson <bruce.richardson@intel.com>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: dev@dpdk.org, Stephen Hemminger <shemming@brocade.com>
Subject: Re: [dpdk-dev] [PATCH 2/6] vhost_xen: remove unnecessary cast
Date: Thu, 19 Feb 2015 14:53:54 +0000 [thread overview]
Message-ID: <20150219145354.GB700@bricha3-MOBL3> (raw)
In-Reply-To: <1423925950-5201-2-git-send-email-shemming@brocade.com>
On Sat, Feb 14, 2015 at 09:59:06AM -0500, Stephen Hemminger wrote:
> Don't need to cast malloc family of functions since they return
> void *.
>
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
> ---
> examples/vhost_xen/vhost_monitor.c | 2 +-
> examples/vhost_xen/xenstore_parse.c | 4 ++--
> 2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/examples/vhost_xen/vhost_monitor.c b/examples/vhost_xen/vhost_monitor.c
> index f683989..9d99962 100644
> --- a/examples/vhost_xen/vhost_monitor.c
> +++ b/examples/vhost_xen/vhost_monitor.c
> @@ -138,7 +138,7 @@ add_xen_guest(int32_t dom_id)
> if ((guest = get_xen_guest(dom_id)) != NULL)
> return guest;
>
> - guest = (struct xen_guest * )calloc(1, sizeof(struct xen_guest));
> + guest = calloc(1, sizeof(struct xen_guest));
> if (guest) {
> RTE_LOG(ERR, XENHOST, " %s: return newly created guest with %d rings\n", __func__, guest->vring_num);
> TAILQ_INSERT_TAIL(&guest_root, guest, next);
> diff --git a/examples/vhost_xen/xenstore_parse.c b/examples/vhost_xen/xenstore_parse.c
> index 9441639..df191ac 100644
> --- a/examples/vhost_xen/xenstore_parse.c
> +++ b/examples/vhost_xen/xenstore_parse.c
> @@ -248,8 +248,8 @@ parse_gntnode(int dom_id, char *path)
> goto err;
> }
>
> - gntnode = (struct xen_gntnode *)calloc(1, sizeof(struct xen_gntnode));
> - gnt = (struct xen_gnt *)calloc(gref_num, sizeof(struct xen_gnt));
> + gntnode = calloc(1, sizeof(struct xen_gntnode));
> + gnt = calloc(gref_num, sizeof(struct xen_gnt));
> if (gnt == NULL || gntnode == NULL)
> goto err;
>
> --
> 2.1.4
>
next prev parent reply other threads:[~2015-02-19 14:53 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-14 14:59 [dpdk-dev] [PATCH 1/6] test: remove unneeded casts Stephen Hemminger
2015-02-14 14:59 ` [dpdk-dev] [PATCH 2/6] vhost_xen: remove unnecessary cast Stephen Hemminger
2015-02-19 14:53 ` Bruce Richardson [this message]
2015-02-14 14:59 ` [dpdk-dev] [PATCH 3/6] bsd: remove useless assignments Stephen Hemminger
2015-02-16 11:31 ` Bruce Richardson
2015-02-14 14:59 ` [dpdk-dev] [PATCH 4/6] enic: eliminate useless cast Stephen Hemminger
2015-02-19 14:57 ` Bruce Richardson
2015-02-14 14:59 ` [dpdk-dev] [PATCH 5/6] eal: remove useless memset Stephen Hemminger
2015-02-19 14:58 ` Bruce Richardson
2015-02-14 14:59 ` [dpdk-dev] [PATCH 6/6] examples: remove unneeded casts Stephen Hemminger
2015-02-19 15:02 ` Bruce Richardson
2015-02-19 14:53 ` [dpdk-dev] [PATCH 1/6] test: " Bruce Richardson
2015-03-04 20:52 ` Thomas Monjalon
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=20150219145354.GB700@bricha3-MOBL3 \
--to=bruce.richardson@intel.com \
--cc=dev@dpdk.org \
--cc=shemming@brocade.com \
--cc=stephen@networkplumber.org \
/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).