From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <bruce.richardson@intel.com>
Received: from mga01.intel.com (mga01.intel.com [192.55.52.88])
 by dpdk.org (Postfix) with ESMTP id 2BC3EB6BA
 for <dev@dpdk.org>; Thu, 19 Feb 2015 16:02:15 +0100 (CET)
Received: from fmsmga001.fm.intel.com ([10.253.24.23])
 by fmsmga101.fm.intel.com with ESMTP; 19 Feb 2015 07:02:06 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.09,609,1418112000"; d="scan'208";a="668639498"
Received: from bricha3-mobl3.ger.corp.intel.com ([10.243.20.37])
 by fmsmga001.fm.intel.com with SMTP; 19 Feb 2015 07:02:04 -0800
Received: by  (sSMTP sendmail emulation); Thu, 19 Feb 2015 15:02:03 +0025
Date: Thu, 19 Feb 2015 15:02:03 +0000
From: Bruce Richardson <bruce.richardson@intel.com>
To: Stephen Hemminger <stephen@networkplumber.org>
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
Content-Disposition: inline
In-Reply-To: <1423925950-5201-6-git-send-email-shemming@brocade.com>
Organization: Intel Shannon Ltd.
User-Agent: Mutt/1.5.23 (2014-03-12)
Cc: dev@dpdk.org, Stephen Hemminger <shemming@brocade.com>
Subject: Re: [dpdk-dev] [PATCH 6/6] examples: remove unneeded casts
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: patches and discussions about DPDK <dev.dpdk.org>
List-Unsubscribe: <http://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <http://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Thu, 19 Feb 2015 15:02:15 -0000

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@networkplumber.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