From patchwork Sat Feb 14 14:59:10 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 3324 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id E418CB4F5; Sat, 14 Feb 2015 15:59:36 +0100 (CET) Received: from mail-ie0-f181.google.com (mail-ie0-f181.google.com [209.85.223.181]) by dpdk.org (Postfix) with ESMTP id 343CCB4D7 for ; Sat, 14 Feb 2015 15:59:33 +0100 (CET) Received: by iecrd18 with SMTP id rd18so25752456iec.5 for ; Sat, 14 Feb 2015 06:59:32 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=kjRbxsRnu8fSDowiUZf458kZxhA7fG5dUHzEr5iuyA8=; b=QXRWgGyzkRM2zOJkdTZ9v3AF6vhtkRnmxXd4R3bUPkIZL0B8U65tkCs4DHlmYfSUjd 12aANdI0RjoFwA4mjkcUJh/FE4A48+FQ5Q3q42Uhee+6+G/N0JPVBIgoaAhIZmLHESUG ZXTS5k6hOqSdJpb3zEfGjggdawIlUd8eYzEg4mKMrfIP6cxV9tQFrRmT4AVcLcci8Fbd K4oIRkO6FyH4Cgx0cWmkFdMLdMrsndrjTolx1BuqKWGmcVWEe2ALVq45hQyc3Dp9abU1 fuB7vIby+Til4aSbeIzAmQxtfb9lk0V7wEXnqlLbV4sgdHCwbWnUQwNxY1h2gHQl9Tyx p0tg== X-Gm-Message-State: ALoCoQm08yfZHcebrybruSGJEjnA0oIRp7PVc3zR9co0+wA46bMQgqCYF/fzq8u9Jz+PSCq1859a X-Received: by 10.43.127.198 with SMTP id hb6mr20094717icc.86.1423925972708; Sat, 14 Feb 2015 06:59:32 -0800 (PST) Received: from uryu.home.lan ([67.210.173.2]) by mx.google.com with ESMTPSA id a125sm6302383ioa.40.2015.02.14.06.59.31 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 14 Feb 2015 06:59:32 -0800 (PST) From: Stephen Hemminger X-Google-Original-From: Stephen Hemminger To: dev@dpdk.org Date: Sat, 14 Feb 2015 09:59:10 -0500 Message-Id: <1423925950-5201-6-git-send-email-shemming@brocade.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1423925950-5201-1-git-send-email-shemming@brocade.com> References: <1423925950-5201-1-git-send-email-shemming@brocade.com> Cc: Stephen Hemminger Subject: [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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" *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/kni/main.c b/examples/kni/main.c index 45b96bc..2bff1e1 100644 --- a/examples/kni/main.c +++ b/examples/kni/main.c @@ -462,8 +462,8 @@ parse_config(const char *arg) goto fail; } kni_port_params_array[port_id] = - (struct kni_port_params*)rte_zmalloc("KNI_port_params", - sizeof(struct kni_port_params), RTE_CACHE_LINE_SIZE); + rte_zmalloc("KNI_port_params", + sizeof(struct kni_port_params), RTE_CACHE_LINE_SIZE); kni_port_params_array[port_id]->port_id = port_id; kni_port_params_array[port_id]->lcore_rx = (uint8_t)int_fld[i++]; diff --git a/examples/l3fwd-acl/main.c b/examples/l3fwd-acl/main.c index f1f7601..20e071a 100644 --- a/examples/l3fwd-acl/main.c +++ b/examples/l3fwd-acl/main.c @@ -1047,13 +1047,13 @@ add_rules(const char *rule_path, fseek(fh, 0, SEEK_SET); - acl_rules = (uint8_t *)calloc(acl_num, rule_size); + acl_rules = calloc(acl_num, rule_size); if (NULL == acl_rules) rte_exit(EXIT_FAILURE, "%s: failed to malloc memory\n", __func__); - route_rules = (uint8_t *)calloc(route_num, rule_size); + route_rules = calloc(route_num, rule_size); if (NULL == route_rules) rte_exit(EXIT_FAILURE, "%s: failed to malloc memory\n", 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); if (vdev->regions_hpa == NULL) { RTE_LOG(ERR, VHOST_CONFIG, "Cannot allocate memory for hpa region\n"); rte_free(vdev);