From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
To: davem@davemloft.net
Cc: Shannon Nelson <shannon.nelson@intel.com>,
netdev@vger.kernel.org, nhorman@redhat.com, sassmann@redhat.com,
jogreene@redhat.com, Laurent Navet <laurent.navet@gmail.com>,
Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Subject: [net-next 07/15] i40e: clean up unneeded gotos
Date: Thu, 23 Jul 2015 06:52:36 -0700 [thread overview]
Message-ID: <1437659564-48822-8-git-send-email-jeffrey.t.kirsher@intel.com> (raw)
In-Reply-To: <1437659564-48822-1-git-send-email-jeffrey.t.kirsher@intel.com>
From: Shannon Nelson <shannon.nelson@intel.com>
With a little work we can clean up some unnecessary logic jumping and
drop a variable.
Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Cc: Laurent Navet <laurent.navet@gmail.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/i40e/i40e_hmc.c | 37 ++++++++++--------------------
1 file changed, 12 insertions(+), 25 deletions(-)
diff --git a/drivers/net/ethernet/intel/i40e/i40e_hmc.c b/drivers/net/ethernet/intel/i40e/i40e_hmc.c
index b89856a..5ebe12d 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_hmc.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_hmc.c
@@ -297,21 +297,15 @@ i40e_status i40e_remove_sd_bp_new(struct i40e_hw *hw,
u32 idx, bool is_pf)
{
struct i40e_hmc_sd_entry *sd_entry;
- i40e_status ret_code = 0;
+
+ if (!is_pf)
+ return I40E_NOT_SUPPORTED;
/* get the entry and decrease its ref counter */
sd_entry = &hmc_info->sd_table.sd_entry[idx];
- if (is_pf) {
- I40E_CLEAR_PF_SD_ENTRY(hw, idx, I40E_SD_TYPE_DIRECT);
- } else {
- ret_code = I40E_NOT_SUPPORTED;
- goto exit;
- }
- ret_code = i40e_free_dma_mem(hw, &(sd_entry->u.bp.addr));
- if (ret_code)
- goto exit;
-exit:
- return ret_code;
+ I40E_CLEAR_PF_SD_ENTRY(hw, idx, I40E_SD_TYPE_DIRECT);
+
+ return i40e_free_dma_mem(hw, &sd_entry->u.bp.addr);
}
/**
@@ -351,20 +345,13 @@ i40e_status i40e_remove_pd_page_new(struct i40e_hw *hw,
struct i40e_hmc_info *hmc_info,
u32 idx, bool is_pf)
{
- i40e_status ret_code = 0;
struct i40e_hmc_sd_entry *sd_entry;
+ if (!is_pf)
+ return I40E_NOT_SUPPORTED;
+
sd_entry = &hmc_info->sd_table.sd_entry[idx];
- if (is_pf) {
- I40E_CLEAR_PF_SD_ENTRY(hw, idx, I40E_SD_TYPE_PAGED);
- } else {
- ret_code = I40E_NOT_SUPPORTED;
- goto exit;
- }
- /* free memory here */
- ret_code = i40e_free_dma_mem(hw, &(sd_entry->u.pd_table.pd_page_addr));
- if (ret_code)
- goto exit;
-exit:
- return ret_code;
+ I40E_CLEAR_PF_SD_ENTRY(hw, idx, I40E_SD_TYPE_PAGED);
+
+ return i40e_free_dma_mem(hw, &sd_entry->u.pd_table.pd_page_addr);
}
--
2.4.3
next prev parent reply other threads:[~2015-07-23 13:52 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-23 13:52 [net-next 00/15][pull request] Intel Wired LAN Driver Updates 2015-07-23 Jeff Kirsher
2015-07-23 13:52 ` [net-next 01/15] ixgbevf: add support for reporting RSS key and hash table for X550 Jeff Kirsher
2015-07-23 13:52 ` [net-next 02/15] e1000e: Cleanup qos request in error handling of e1000_open Jeff Kirsher
2015-07-23 13:52 ` [net-next 03/15] igb: report unsupported ethtool settings in set_coalesce Jeff Kirsher
2015-07-23 13:52 ` [net-next 04/15] igb: use ARRAY_SIZE to replace calculating sizeof(a)/sizeof(a[0]) Jeff Kirsher
2015-07-23 13:52 ` [net-next 05/15] igb: bump version to igb-5.3.0 Jeff Kirsher
2015-07-23 13:52 ` [net-next 06/15] i40e/i40evf: Fix and refactor dynamic ITR code Jeff Kirsher
2015-07-23 13:52 ` Jeff Kirsher [this message]
2015-07-23 13:52 ` [net-next 08/15] i40e: add VF capabilities to virtual channel interface Jeff Kirsher
2015-07-23 13:52 ` [net-next 09/15] i40e/i40evf: add macros for virtual channel API version and device capability Jeff Kirsher
2015-07-23 13:52 ` [net-next 10/15] i40e: support virtual channel API 1.1 Jeff Kirsher
2015-07-23 13:52 ` [net-next 11/15] i40evf: handle big resets Jeff Kirsher
2015-07-23 13:52 ` [net-next 12/15] i40evf: support virtual channel API version 1.1 Jeff Kirsher
2015-07-23 13:52 ` [net-next 13/15] i40e: provide correct API version to older VF drivers Jeff Kirsher
2015-07-23 13:52 ` [net-next 14/15] i40e: clean up error status messages Jeff Kirsher
2015-07-23 13:52 ` [net-next 15/15] i40e: use BIT and BIT_ULL macros Jeff Kirsher
2015-07-25 7:16 ` [net-next 00/15][pull request] Intel Wired LAN Driver Updates 2015-07-23 David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1437659564-48822-8-git-send-email-jeffrey.t.kirsher@intel.com \
--to=jeffrey.t.kirsher@intel.com \
--cc=davem@davemloft.net \
--cc=jogreene@redhat.com \
--cc=laurent.navet@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=nhorman@redhat.com \
--cc=sassmann@redhat.com \
--cc=shannon.nelson@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).