* [PATCH] i40iw: Simplify code
@ 2017-07-16 11:09 Christophe JAILLET
2017-07-16 15:11 ` Joe Perches
2017-07-17 19:31 ` Shiraz Saleem
0 siblings, 2 replies; 4+ messages in thread
From: Christophe JAILLET @ 2017-07-16 11:09 UTC (permalink / raw)
To: faisal.latif, shiraz.saleem, dledford, sean.hefty, hal.rosenstock
Cc: linux-rdma, linux-kernel, kernel-janitors, Christophe JAILLET
Axe a few lines of code and re-use existing error handling path to avoid
code duplication.
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
drivers/infiniband/hw/i40iw/i40iw_pble.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/drivers/infiniband/hw/i40iw/i40iw_pble.c b/drivers/infiniband/hw/i40iw/i40iw_pble.c
index c87ba1617087..540aab5e502d 100644
--- a/drivers/infiniband/hw/i40iw/i40iw_pble.c
+++ b/drivers/infiniband/hw/i40iw/i40iw_pble.c
@@ -269,10 +269,8 @@ static enum i40iw_status_code add_bp_pages(struct i40iw_sc_dev *dev,
status = i40iw_add_sd_table_entry(dev->hw, hmc_info,
info->idx.sd_idx, I40IW_SD_TYPE_PAGED,
I40IW_HMC_DIRECT_BP_SIZE);
- if (status) {
- i40iw_free_vmalloc_mem(dev->hw, chunk);
- return status;
- }
+ if (status)
+ goto error;
if (!dev->is_pf) {
status = i40iw_vchnl_vf_add_hmc_objs(dev, I40IW_HMC_IW_PBLE,
fpm_to_idx(pble_rsrc,
@@ -280,8 +278,7 @@ static enum i40iw_status_code add_bp_pages(struct i40iw_sc_dev *dev,
(info->pages << PBLE_512_SHIFT));
if (status) {
i40iw_pr_err("allocate PBLEs in the PF. Error %i\n", status);
- i40iw_free_vmalloc_mem(dev->hw, chunk);
- return status;
+ goto error;
}
}
addr = chunk->vaddr;
--
2.11.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] i40iw: Simplify code
2017-07-16 11:09 [PATCH] i40iw: Simplify code Christophe JAILLET
@ 2017-07-16 15:11 ` Joe Perches
2017-07-17 19:31 ` Shiraz Saleem
1 sibling, 0 replies; 4+ messages in thread
From: Joe Perches @ 2017-07-16 15:11 UTC (permalink / raw)
To: Christophe JAILLET, faisal.latif, shiraz.saleem, dledford,
sean.hefty, hal.rosenstock
Cc: linux-rdma, linux-kernel, kernel-janitors
On Sun, 2017-07-16 at 13:09 +0200, Christophe JAILLET wrote:
> Axe a few lines of code and re-use existing error handling path to avoid
> code duplication.
unrelated:
> diff --git a/drivers/infiniband/hw/i40iw/i40iw_pble.c b/drivers/infiniband/hw/i40iw/i40iw_pble.c
[]
> @@ -280,8 +278,7 @@ static enum i40iw_status_code add_bp_pages(struct i40iw_sc_dev *dev,
> (info->pages << PBLE_512_SHIFT));
> if (status) {
> i40iw_pr_err("allocate PBLEs in the PF. Error %i\n", status);
It'd be nice if i40iw_pr_<err|warn|info> were removed and
converted into dev_<err|warn|info> or netdev_<err|warn|info>.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] i40iw: Simplify code
2017-07-16 11:09 [PATCH] i40iw: Simplify code Christophe JAILLET
2017-07-16 15:11 ` Joe Perches
@ 2017-07-17 19:31 ` Shiraz Saleem
2017-08-18 16:03 ` Doug Ledford
1 sibling, 1 reply; 4+ messages in thread
From: Shiraz Saleem @ 2017-07-17 19:31 UTC (permalink / raw)
To: Christophe JAILLET
Cc: faisal.latif, dledford, sean.hefty, hal.rosenstock, linux-rdma,
linux-kernel, kernel-janitors
On Sun, Jul 16, 2017 at 01:09:23PM +0200, Christophe JAILLET wrote:
> Axe a few lines of code and re-use existing error handling path to avoid
> code duplication.
>
Acked-by: Shiraz Saleem <shiraz.saleem@intel.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] i40iw: Simplify code
2017-07-17 19:31 ` Shiraz Saleem
@ 2017-08-18 16:03 ` Doug Ledford
0 siblings, 0 replies; 4+ messages in thread
From: Doug Ledford @ 2017-08-18 16:03 UTC (permalink / raw)
To: Shiraz Saleem, Christophe JAILLET
Cc: faisal.latif, sean.hefty, hal.rosenstock, linux-rdma,
linux-kernel, kernel-janitors
On Mon, 2017-07-17 at 14:31 -0500, Shiraz Saleem wrote:
> On Sun, Jul 16, 2017 at 01:09:23PM +0200, Christophe JAILLET wrote:
> > Axe a few lines of code and re-use existing error handling path to
> > avoid
> > code duplication.
> >
>
> Acked-by: Shiraz Saleem <shiraz.saleem@intel.com>
Thanks, applied.
--
Doug Ledford <dledford@redhat.com>
GPG KeyID: B826A3330E572FDD
Key fingerprint = AE6B 1BDA 122B 23B4 265B 1274 B826 A333 0E57 2FDD
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-08-18 16:03 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-16 11:09 [PATCH] i40iw: Simplify code Christophe JAILLET
2017-07-16 15:11 ` Joe Perches
2017-07-17 19:31 ` Shiraz Saleem
2017-08-18 16:03 ` Doug Ledford
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).