* [PATCH] s390: zfcp_aux: remove unnecessary null pointer check before mempool_destroy
@ 2018-09-08 9:41 zhong jiang
2018-09-10 6:23 ` Benjamin Block
2018-09-10 6:35 ` Martin Schwidefsky
0 siblings, 2 replies; 3+ messages in thread
From: zhong jiang @ 2018-09-08 9:41 UTC (permalink / raw)
To: maier, bblock, schwidefsky, heiko.carstens; +Cc: linux-s390, linux-kernel
mempool_destroy has taken null pointer check into account. so remove the
redundant check.
Signed-off-by: zhong jiang <zhongjiang@huawei.com>
---
drivers/s390/scsi/zfcp_aux.c | 21 +++++++--------------
1 file changed, 7 insertions(+), 14 deletions(-)
diff --git a/drivers/s390/scsi/zfcp_aux.c b/drivers/s390/scsi/zfcp_aux.c
index 94f4d8f..e06c3f2 100644
--- a/drivers/s390/scsi/zfcp_aux.c
+++ b/drivers/s390/scsi/zfcp_aux.c
@@ -248,20 +248,13 @@ static int zfcp_allocate_low_mem_buffers(struct zfcp_adapter *adapter)
static void zfcp_free_low_mem_buffers(struct zfcp_adapter *adapter)
{
- if (adapter->pool.erp_req)
- mempool_destroy(adapter->pool.erp_req);
- if (adapter->pool.scsi_req)
- mempool_destroy(adapter->pool.scsi_req);
- if (adapter->pool.scsi_abort)
- mempool_destroy(adapter->pool.scsi_abort);
- if (adapter->pool.qtcb_pool)
- mempool_destroy(adapter->pool.qtcb_pool);
- if (adapter->pool.status_read_req)
- mempool_destroy(adapter->pool.status_read_req);
- if (adapter->pool.sr_data)
- mempool_destroy(adapter->pool.sr_data);
- if (adapter->pool.gid_pn)
- mempool_destroy(adapter->pool.gid_pn);
+ mempool_destroy(adapter->pool.erp_req);
+ mempool_destroy(adapter->pool.scsi_req);
+ mempool_destroy(adapter->pool.scsi_abort);
+ mempool_destroy(adapter->pool.qtcb_pool);
+ mempool_destroy(adapter->pool.status_read_req);
+ mempool_destroy(adapter->pool.sr_data);
+ mempool_destroy(adapter->pool.gid_pn);
}
/**
--
1.7.12.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] s390: zfcp_aux: remove unnecessary null pointer check before mempool_destroy
2018-09-08 9:41 [PATCH] s390: zfcp_aux: remove unnecessary null pointer check before mempool_destroy zhong jiang
@ 2018-09-10 6:23 ` Benjamin Block
2018-09-10 6:35 ` Martin Schwidefsky
1 sibling, 0 replies; 3+ messages in thread
From: Benjamin Block @ 2018-09-10 6:23 UTC (permalink / raw)
To: zhong jiang; +Cc: maier, schwidefsky, heiko.carstens, linux-s390, linux-kernel
On Sat, Sep 08, 2018 at 05:41:45PM +0800, zhong jiang wrote:
> mempool_destroy has taken null pointer check into account. so remove the
> redundant check.
>
> Signed-off-by: zhong jiang <zhongjiang@huawei.com>
> ---
> drivers/s390/scsi/zfcp_aux.c | 21 +++++++--------------
> 1 file changed, 7 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/s390/scsi/zfcp_aux.c b/drivers/s390/scsi/zfcp_aux.c
> index 94f4d8f..e06c3f2 100644
> --- a/drivers/s390/scsi/zfcp_aux.c
> +++ b/drivers/s390/scsi/zfcp_aux.c
> @@ -248,20 +248,13 @@ static int zfcp_allocate_low_mem_buffers(struct zfcp_adapter *adapter)
>
> static void zfcp_free_low_mem_buffers(struct zfcp_adapter *adapter)
> {
> - if (adapter->pool.erp_req)
> - mempool_destroy(adapter->pool.erp_req);
> - if (adapter->pool.scsi_req)
> - mempool_destroy(adapter->pool.scsi_req);
> - if (adapter->pool.scsi_abort)
> - mempool_destroy(adapter->pool.scsi_abort);
> - if (adapter->pool.qtcb_pool)
> - mempool_destroy(adapter->pool.qtcb_pool);
> - if (adapter->pool.status_read_req)
> - mempool_destroy(adapter->pool.status_read_req);
> - if (adapter->pool.sr_data)
> - mempool_destroy(adapter->pool.sr_data);
> - if (adapter->pool.gid_pn)
> - mempool_destroy(adapter->pool.gid_pn);
> + mempool_destroy(adapter->pool.erp_req);
> + mempool_destroy(adapter->pool.scsi_req);
> + mempool_destroy(adapter->pool.scsi_abort);
> + mempool_destroy(adapter->pool.qtcb_pool);
> + mempool_destroy(adapter->pool.status_read_req);
> + mempool_destroy(adapter->pool.sr_data);
> + mempool_destroy(adapter->pool.gid_pn);
> }
>
Acked-by: Benjamin Block <bblock@linux.ibm.com>
Thank you. We'll send it along when we next send patches upstream.
--
With Best Regards, Benjamin Block / Linux on IBM Z Kernel Development
IBM Systems & Technology Group / IBM Deutschland Research & Development GmbH
Vorsitz. AufsR.: Martina Koederitz / Geschäftsführung: Dirk Wittkopp
Sitz der Gesellschaft: Böblingen / Registergericht: AmtsG Stuttgart, HRB 243294
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] s390: zfcp_aux: remove unnecessary null pointer check before mempool_destroy
2018-09-08 9:41 [PATCH] s390: zfcp_aux: remove unnecessary null pointer check before mempool_destroy zhong jiang
2018-09-10 6:23 ` Benjamin Block
@ 2018-09-10 6:35 ` Martin Schwidefsky
1 sibling, 0 replies; 3+ messages in thread
From: Martin Schwidefsky @ 2018-09-10 6:35 UTC (permalink / raw)
To: zhong jiang; +Cc: maier, bblock, heiko.carstens, linux-s390, linux-kernel
On Sat, 8 Sep 2018 17:41:45 +0800
zhong jiang <zhongjiang@huawei.com> wrote:
> mempool_destroy has taken null pointer check into account. so remove the
> redundant check.
>
> Signed-off-by: zhong jiang <zhongjiang@huawei.com>
> ---
> drivers/s390/scsi/zfcp_aux.c | 21 +++++++--------------
> 1 file changed, 7 insertions(+), 14 deletions(-)
Applied to linux-390:features. Thanks.
--
blue skies,
Martin.
"Reality continues to ruin my life." - Calvin.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-09-10 6:35 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-08 9:41 [PATCH] s390: zfcp_aux: remove unnecessary null pointer check before mempool_destroy zhong jiang
2018-09-10 6:23 ` Benjamin Block
2018-09-10 6:35 ` Martin Schwidefsky
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).