[dpdk-dev] [PATCH 10/11] i40e: remove useless cast

Stephen Hemminger stephen at networkplumber.org
Fri Jul 24 19:06:23 CEST 2015


drivers/net/i40e/i40e_ethdev.c:2360:18-56: WARNING: casting value returned by memory allocation function to (struct i40e_aqc_get_switch_config_resp *) is useless.

Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
---
 drivers/net/i40e/i40e_ethdev.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 40b0526..0e19f2e 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -2357,8 +2357,7 @@ i40e_pf_get_switch_config(struct i40e_pf *pf)
 	uint16_t start_seid = 0, num_reported;
 	int ret;
 
-	switch_config = (struct i40e_aqc_get_switch_config_resp *)\
-			rte_zmalloc("i40e", I40E_AQ_LARGE_BUF, 0);
+	switch_config = rte_zmalloc("i40e", I40E_AQ_LARGE_BUF, 0);
 	if (!switch_config) {
 		PMD_DRV_LOG(ERR, "Failed to allocated memory");
 		return -ENOMEM;
-- 
2.1.4



More information about the dev mailing list