All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bruce Richardson <bruce.richardson-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
To: Stephen Hemminger
	<stephen-OTpzqLSitTUnbdJkjeBofR2eb7JE58TQ@public.gmane.org>
Cc: dev-VfR2kkLFssw@public.gmane.org,
	Stephen Hemminger
	<shemming-43mecJUBy8ZBDgjK7y7TUQ@public.gmane.org>
Subject: Re: [PATCH 6/6] examples: remove unneeded casts
Date: Thu, 19 Feb 2015 15:02:03 +0000	[thread overview]
Message-ID: <20150219150203.GE700@bricha3-MOBL3> (raw)
In-Reply-To: <1423925950-5201-6-git-send-email-shemming-43mecJUBy8ZBDgjK7y7TUQ@public.gmane.org>

On Sat, Feb 14, 2015 at 09:59:10AM -0500, Stephen Hemminger wrote:
> *alloc() routines return void * and therefore cast is not needed.
> 
> Signed-off-by: Stephen Hemminger <stephen-OTpzqLSitTUnbdJkjeBofR2eb7JE58TQ@public.gmane.org>
> ---
>  examples/kni/main.c       | 4 ++--
>  examples/l3fwd-acl/main.c | 4 ++--
>  examples/vhost/main.c     | 7 ++++---
>  3 files changed, 8 insertions(+), 7 deletions(-)
> 
... <snip> ...
> diff --git a/examples/vhost/main.c b/examples/vhost/main.c
> index 3a35359..a96b19f 100644
> --- a/examples/vhost/main.c
> +++ b/examples/vhost/main.c
> @@ -2592,9 +2592,10 @@ new_device (struct virtio_net *dev)
>  
>  		}
>  
> -		vdev->regions_hpa = (struct virtio_memory_regions_hpa *) rte_zmalloc("vhost hpa region",
> -			sizeof(struct virtio_memory_regions_hpa) * vdev->nregions_hpa,
> -			RTE_CACHE_LINE_SIZE);
> +		vdev->regions_hpa = rte_calloc("vhost hpa region",
> +					       sizeof(struct virtio_memory_regions_hpa),
> +					       vdev->nregions_hpa,
> +					       RTE_CACHE_LINE_SIZE);

I know functionally it probably doesn't make a difference, but I think your
"num" and "size" parameters are reversed here.

/Bruce

  parent reply	other threads:[~2015-02-19 15:02 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-14 14:59 [PATCH 1/6] test: remove unneeded casts Stephen Hemminger
     [not found] ` <1423925950-5201-1-git-send-email-shemming-43mecJUBy8ZBDgjK7y7TUQ@public.gmane.org>
2015-02-14 14:59   ` [PATCH 2/6] vhost_xen: remove unnecessary cast Stephen Hemminger
     [not found]     ` <1423925950-5201-2-git-send-email-shemming-43mecJUBy8ZBDgjK7y7TUQ@public.gmane.org>
2015-02-19 14:53       ` Bruce Richardson
2015-02-14 14:59   ` [PATCH 3/6] bsd: remove useless assignments Stephen Hemminger
     [not found]     ` <1423925950-5201-3-git-send-email-shemming-43mecJUBy8ZBDgjK7y7TUQ@public.gmane.org>
2015-02-16 11:31       ` Bruce Richardson
2015-02-14 14:59   ` [PATCH 4/6] enic: eliminate useless cast Stephen Hemminger
     [not found]     ` <1423925950-5201-4-git-send-email-shemming-43mecJUBy8ZBDgjK7y7TUQ@public.gmane.org>
2015-02-19 14:57       ` Bruce Richardson
2015-02-14 14:59   ` [PATCH 5/6] eal: remove useless memset Stephen Hemminger
     [not found]     ` <1423925950-5201-5-git-send-email-shemming-43mecJUBy8ZBDgjK7y7TUQ@public.gmane.org>
2015-02-19 14:58       ` Bruce Richardson
2015-02-14 14:59   ` [PATCH 6/6] examples: remove unneeded casts Stephen Hemminger
     [not found]     ` <1423925950-5201-6-git-send-email-shemming-43mecJUBy8ZBDgjK7y7TUQ@public.gmane.org>
2015-02-19 15:02       ` Bruce Richardson [this message]
2015-02-19 14:53   ` [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=20150219150203.GE700@bricha3-MOBL3 \
    --to=bruce.richardson-ral2jqcrhueavxtiumwx3w@public.gmane.org \
    --cc=dev-VfR2kkLFssw@public.gmane.org \
    --cc=shemming-43mecJUBy8ZBDgjK7y7TUQ@public.gmane.org \
    --cc=stephen-OTpzqLSitTUnbdJkjeBofR2eb7JE58TQ@public.gmane.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.