* [PATCH] s390/dasd: remove unnecessary condition check
@ 2018-08-27 23:51 Chengguang Xu
2018-09-06 13:11 ` Jan Höppner
0 siblings, 1 reply; 2+ messages in thread
From: Chengguang Xu @ 2018-08-27 23:51 UTC (permalink / raw)
To: linux-s390
kmem_cache_destroy() can handle NULL pointer correctly, so there is
no need to check NULL pointer before calling kmem_cache_destroy().
Signed-off-by: Chengguang Xu <cgxu519@gmx.com>
---
drivers/s390/block/dasd.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c
index a23e7d394a0a..5e9ebdb0594c 100644
--- a/drivers/s390/block/dasd.c
+++ b/drivers/s390/block/dasd.c
@@ -3309,10 +3309,8 @@ dasd_exit(void)
dasd_proc_exit();
#endif
dasd_eer_exit();
- if (dasd_page_cache != NULL) {
- kmem_cache_destroy(dasd_page_cache);
- dasd_page_cache = NULL;
- }
+ kmem_cache_destroy(dasd_page_cache);
+ dasd_page_cache = NULL;
dasd_gendisk_exit();
dasd_devmap_exit();
if (dasd_debug_area != NULL) {
--
2.17.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] s390/dasd: remove unnecessary condition check
2018-08-27 23:51 [PATCH] s390/dasd: remove unnecessary condition check Chengguang Xu
@ 2018-09-06 13:11 ` Jan Höppner
0 siblings, 0 replies; 2+ messages in thread
From: Jan Höppner @ 2018-09-06 13:11 UTC (permalink / raw)
To: linux-s390
On 28.08.2018 01:51, Chengguang Xu wrote:
> kmem_cache_destroy() can handle NULL pointer correctly, so there is
> no need to check NULL pointer before calling kmem_cache_destroy().
>
> Signed-off-by: Chengguang Xu <cgxu519@gmx.com>
> ---
> drivers/s390/block/dasd.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c
> index a23e7d394a0a..5e9ebdb0594c 100644
> --- a/drivers/s390/block/dasd.c
> +++ b/drivers/s390/block/dasd.c
> @@ -3309,10 +3309,8 @@ dasd_exit(void)
> dasd_proc_exit();
> #endif
> dasd_eer_exit();
> - if (dasd_page_cache != NULL) {
> - kmem_cache_destroy(dasd_page_cache);
> - dasd_page_cache = NULL;
> - }
> + kmem_cache_destroy(dasd_page_cache);
> + dasd_page_cache = NULL;
> dasd_gendisk_exit();
> dasd_devmap_exit();
> if (dasd_debug_area != NULL) {
>
Applied. Thanks a lot!
Regards,
Jan
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-09-06 13:11 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-08-27 23:51 [PATCH] s390/dasd: remove unnecessary condition check Chengguang Xu
2018-09-06 13:11 ` Jan Höppner
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).