NVMe: nvme_core_exit() should do cleanup in the reverse order as nvme_core_init does
PATCH 1/1 NVMe: nvme_core_exit() should do cleanup in the reverse order as nvme_core_init does
nvme_core_init does:
1) register_blkdev
2) __register_chrdev
3) class_create
nvme_core_exit should do cleanup in the reverse order.
--- drivers/nvme/host/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/nvme/host/core.c +1 -1
@@ -1607,9 +1607,9 @@ int __init nvme_core_init(void)void nvme_core_exit (void ) { -unregister_blkdev (nvme_major,"nvme" );class_destroy (nvme_class);__unregister_chrdev (nvme_char_major,0 ,NVME_MINORS ,"nvme" ); +unregister_blkdev (nvme_major,"nvme" ); }MODULE_LICENSE ("GPL" );
Signature · 1 line
2.7.4
PATCH 1/1 NVMe: nvme_core_exit() should do cleanup in the reverse order as nvme_core_init does
Quoted 6 lines · Wang Sheng-Hui
nvme_core_initdoes:
1)register_blkdev
2)__register_chrdev
3)class_create
nvme_core_exitshould do cleanup in the reverse order.
Not sure why this would matter, but it looks correct to me:
PATCH 1/1 NVMe: nvme_core_exit() should do cleanup in the reverseorder as nvme_core_init does
Christoph,
The order of the statements doesn't impact current implementation. No dependance between the data structures referred in each step. It's kind of code cleanup.
Regards,
Wang Sheng-Hui
------------------ Original ------------------
From: "Christoph Hellwig";<[email protected]>; Date: Mon, May 2, 2016 02:05 AM To: "Wang Sheng-Hui"<shhuiw at foxmail.com>;
Cc: "keith.busch"<keith.busch at intel.com>; "axboe"<axboe at fb.com>; "linux-nvme"<linux-nvme at lists.infradead.org>;
Subject: Re: [PATCH] NVMe: nvme_core_exit() should do cleanup in the reverseorder as nvme_core_init does
Quoted 6 lines · Wang Sheng-Hui
nvme_core_initdoes:
1)register_blkdev
2)__register_chrdev
3)class_create
nvme_core_exitshould do cleanup in the reverse order.
Not sure why this would matter, but it looks correct to me:
_______________________________________________
Linux-nvme mailing list
Linux-nvme at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme
PATCH 1/1 NVMe: nvme_core_exit() should do cleanup in the reverse order as nvme_core_init does
In reply to Wang Sheng-HuiQuoted 6 lines · Wang Sheng-Hui
nvme_core_initdoes:
1)register_blkdev
2)__register_chrdev
3)class_create
nvme_core_exitshould do cleanup in the reverse order.
Added for 4.7.
Signature · 1 line
Jens Axboe