From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <stephen@networkplumber.org>
Received: from mail-pa0-f43.google.com (mail-pa0-f43.google.com
 [209.85.220.43]) by dpdk.org (Postfix) with ESMTP id 7B540C494
 for <dev@dpdk.org>; Fri, 24 Jul 2015 19:06:29 +0200 (CEST)
Received: by pachj5 with SMTP id hj5so17138253pac.3
 for <dev@dpdk.org>; Fri, 24 Jul 2015 10:06:28 -0700 (PDT)
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=BoCghUo9sJXUTWKR/6HGX0XBSJmVXxj/TqXBujJ+VVQ=;
 b=iCOJO/aUU+VCJ5L73QkjBmR8fITHM0rpJrc/IFIJx9KwwF96jvxvDgdayXuAjA6BLS
 XFCnIdUNabRVPgUmZU46CGXWjXbgxR6uh7F1dWKMMfU3ILfBAPDPxzqWcQnFxx4jk3vA
 gdkkUh326W/vwQBNUikF+3m4Ww2yPHxE+pc23jGk9vq5hFc3669LyzE9B49mKErSxXpb
 f9dN08i1B6cinYMtkigp2q6WHtzHfA71DLgAufgH+sB/tckzhJzZnLSdpVt2/Ii0Jy8d
 F8FqNV4oFetqnPxzjUNsokWdyhZdknkHE61/DEtI1qrEse+e6thXwpUxfmwyUlc7M+dU
 kMlw==
X-Gm-Message-State: ALoCoQnz0gfOYJJlZiN3sLMrJ1krnwvGjIqteavytxcE7ixtHd0vfovxYCdv2GvpCwv8wrM2xRno
X-Received: by 10.66.230.201 with SMTP id ta9mr33267464pac.95.1437757588901;
 Fri, 24 Jul 2015 10:06:28 -0700 (PDT)
Received: from urahara.home.lan (static-50-53-82-155.bvtn.or.frontiernet.net.
 [50.53.82.155])
 by smtp.gmail.com with ESMTPSA id ra10sm15635403pab.19.2015.07.24.10.06.27
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128);
 Fri, 24 Jul 2015 10:06:28 -0700 (PDT)
From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Date: Fri, 24 Jul 2015 10:06:22 -0700
Message-Id: <1437757584-15502-10-git-send-email-stephen@networkplumber.org>
X-Mailer: git-send-email 2.1.4
In-Reply-To: <1437757584-15502-1-git-send-email-stephen@networkplumber.org>
References: <1437757584-15502-1-git-send-email-stephen@networkplumber.org>
Subject: [dpdk-dev] [PATCH 09/11] kni: remove useless cast
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: Fri, 24 Jul 2015 17:06:29 -0000

lib/librte_kni/rte_kni.c:224:27-54: WARNING: casting value returned by memory allocation function to (struct rte_kni_memzone_slot *) is useless.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 lib/librte_kni/rte_kni.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/lib/librte_kni/rte_kni.c b/lib/librte_kni/rte_kni.c
index 08155db..fd70448 100644
--- a/lib/librte_kni/rte_kni.c
+++ b/lib/librte_kni/rte_kni.c
@@ -221,11 +221,8 @@ rte_kni_init(unsigned int max_kni_ifaces)
 	}
 
 	/* Allocate slot objects */
-	kni_memzone_pool.slots = (struct rte_kni_memzone_slot *)
-					rte_malloc(NULL,
-					sizeof(struct rte_kni_memzone_slot) *
-					max_kni_ifaces,
-					0);
+	kni_memzone_pool.slots = rte_calloc(NULL, max_kni_ifaces,
+				    sizeof(struct rte_kni_memzone_slot), 0);
 	KNI_MEM_CHECK(kni_memzone_pool.slots == NULL);
 
 	/* Initialize general pool variables */
-- 
2.1.4