From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 7EBA2A045E for ; Wed, 29 May 2019 21:16:49 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B50171B9C9; Wed, 29 May 2019 21:15:36 +0200 (CEST) Received: from mail-pf1-f193.google.com (mail-pf1-f193.google.com [209.85.210.193]) by dpdk.org (Postfix) with ESMTP id 1DD721B997 for ; Wed, 29 May 2019 21:15:14 +0200 (CEST) Received: by mail-pf1-f193.google.com with SMTP id c6so2240632pfa.10 for ; Wed, 29 May 2019 12:15:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=mBZcXtuhWE0FAr+/NaCVTGXEYT10KCBgHECR7N/Hklg=; b=BjKBNgE+PCeqWCRZeIcwx7V6lFxJhGWS+rg1kefEkghOuwch1T3XmIrS+zIcrR0cKU 2vc2SBPSO8sl/FcOFvc53z+fkPgcbYHAhwtzZ8wNUpX7AFBV6nA1gETqnBRsjD6QrIQb k0Dp/1Ub8Y4E0kzRsTsU58kApjG4lTRrb/ecOfX0w7guA0XxZOUbgnZtUNBsH62Zcsvs QtoV33ExtVA9/9AqKcxNS8JDgwYld4o7MS8f0MCdQ69u0fjByFw+/B9S0lELT9vqoqb6 rPRKFrBFlV1xkoVkNYNJFforyQZkj4srQIsHB8fVlS3qFs5cpmEDUMnr60aRwh2PxH11 B7CQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=mBZcXtuhWE0FAr+/NaCVTGXEYT10KCBgHECR7N/Hklg=; b=RZ9/NCUaKkrT5lz1XFzKk4lEIMCQhtsWMY47w6EftAE7yCvWTsMCXweRcUenMj3eCb 0s54JqWw5o7o7T8f+5uTUJ1MoF2ip9zgMlSLfEPqCfTD8/pC5aNiGbrhPX3UCai0dkB2 xhvTYsZ+hbaRhY0Y4eDZsKH6Luqn49CsoAP9fthM4Z+TDzTaTy11Hg35e8QjWSnPAltP HHl8FKosjBh+xQdAhA3BBAicEy6eXQZBPgoAe8zxJ46cyr22NJqQQZuOakMGnLmWHfQO CqRbD/aEjhotvK6RhC0iPOyD7TyQ42UliUinhj5PS1nDAskK6z03xEyo+QYL0FmgLAMy 6RsQ== X-Gm-Message-State: APjAAAW0qCVbzkWGOgKcSSQ0YtSRooJRkgj4DpfwgG0Yz1LMC2BaUna8 2BfuO+xOtViN/o8vhaqv797HCJJ9HH0= X-Google-Smtp-Source: APXvYqw6GApXXcPrZxoM7ysWuBit05AkMDlIE9y+vvUHLBM7DFWtmu3+2n7VpsmfbIvw5eqd1NInXg== X-Received: by 2002:a62:1c92:: with SMTP id c140mr6151973pfc.258.1559157313006; Wed, 29 May 2019 12:15:13 -0700 (PDT) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id t18sm142943pgm.69.2019.05.29.12.15.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 29 May 2019 12:15:12 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Date: Wed, 29 May 2019 12:14:59 -0700 Message-Id: <20190529191501.19053-11-stephen@networkplumber.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190529191501.19053-1-stephen@networkplumber.org> References: <20190529191501.19053-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH 10/12] net/i40e: remove unnecessary cast X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" The device private pointer (dev_private) is of type void * therefore no cast is necessary in C. Signed-off-by: Stephen Hemminger --- drivers/net/i40e/i40e_ethdev.c | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index f4d778ea2df7..24b2ce245557 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -1211,11 +1211,9 @@ i40e_parse_latest_vec_handler(__rte_unused const char *key, const char *value, void *opaque) { - struct i40e_adapter *ad; + struct i40e_adapter *ad = opaque; int use_latest_vec; - ad = (struct i40e_adapter *)opaque; - use_latest_vec = atoi(value); if (use_latest_vec != 0 && use_latest_vec != 1) @@ -10843,8 +10841,7 @@ static void i40e_start_timecounters(struct rte_eth_dev *dev) { struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private); - struct i40e_adapter *adapter = - (struct i40e_adapter *)dev->data->dev_private; + struct i40e_adapter *adapter = dev->data->dev_private; struct rte_eth_link link; uint32_t tsync_inc_l; uint32_t tsync_inc_h; @@ -10896,8 +10893,7 @@ i40e_start_timecounters(struct rte_eth_dev *dev) static int i40e_timesync_adjust_time(struct rte_eth_dev *dev, int64_t delta) { - struct i40e_adapter *adapter = - (struct i40e_adapter *)dev->data->dev_private; + struct i40e_adapter *adapter = dev->data->dev_private; adapter->systime_tc.nsec += delta; adapter->rx_tstamp_tc.nsec += delta; @@ -10910,8 +10906,7 @@ static int i40e_timesync_write_time(struct rte_eth_dev *dev, const struct timespec *ts) { uint64_t ns; - struct i40e_adapter *adapter = - (struct i40e_adapter *)dev->data->dev_private; + struct i40e_adapter *adapter = dev->data->dev_private; ns = rte_timespec_to_ns(ts); @@ -10927,8 +10922,7 @@ static int i40e_timesync_read_time(struct rte_eth_dev *dev, struct timespec *ts) { uint64_t ns, systime_cycles; - struct i40e_adapter *adapter = - (struct i40e_adapter *)dev->data->dev_private; + struct i40e_adapter *adapter = dev->data->dev_private; systime_cycles = i40e_read_systime_cyclecounter(dev); ns = rte_timecounter_update(&adapter->systime_tc, systime_cycles); @@ -11004,9 +10998,7 @@ i40e_timesync_read_rx_timestamp(struct rte_eth_dev *dev, struct timespec *timestamp, uint32_t flags) { struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private); - struct i40e_adapter *adapter = - (struct i40e_adapter *)dev->data->dev_private; - + struct i40e_adapter *adapter = dev->data->dev_private; uint32_t sync_status; uint32_t index = flags & 0x03; uint64_t rx_tstamp_cycles; @@ -11028,9 +11020,7 @@ i40e_timesync_read_tx_timestamp(struct rte_eth_dev *dev, struct timespec *timestamp) { struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private); - struct i40e_adapter *adapter = - (struct i40e_adapter *)dev->data->dev_private; - + struct i40e_adapter *adapter = dev->data->dev_private; uint32_t sync_status; uint64_t tx_tstamp_cycles; uint64_t ns; -- 2.20.1