From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bruce Richardson Subject: Re: [PATCH 6/6] examples: remove unneeded casts Date: Thu, 19 Feb 2015 15:02:03 +0000 Message-ID: <20150219150203.GE700@bricha3-MOBL3> References: <1423925950-5201-1-git-send-email-shemming@brocade.com> <1423925950-5201-6-git-send-email-shemming@brocade.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: dev-VfR2kkLFssw@public.gmane.org, Stephen Hemminger To: Stephen Hemminger Return-path: Content-Disposition: inline In-Reply-To: <1423925950-5201-6-git-send-email-shemming-43mecJUBy8ZBDgjK7y7TUQ@public.gmane.org> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces-VfR2kkLFssw@public.gmane.org Sender: "dev" 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 > --- > examples/kni/main.c | 4 ++-- > examples/l3fwd-acl/main.c | 4 ++-- > examples/vhost/main.c | 7 ++++--- > 3 files changed, 8 insertions(+), 7 deletions(-) > ... ... > 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