All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] NVMe: nvme_core_exit() should do cleanup in the reverse order as nvme_core_init does
@ 2016-04-28  8:19 Wang Sheng-Hui
  2016-05-01 18:05 ` Christoph Hellwig
  2016-05-02 15:11 ` [PATCH] NVMe: nvme_core_exit() should do cleanup in the reverse order " Jens Axboe
  0 siblings, 2 replies; 4+ messages in thread
From: Wang Sheng-Hui @ 2016-04-28  8:19 UTC (permalink / raw)


nvme_core_init does:
    1) register_blkdev
    2) __register_chrdev
    3) class_create

nvme_core_exit should do cleanup in the reverse order.

Signed-off-by: Wang Sheng-Hui <shhuiw at foxmail.com>
---
 drivers/nvme/host/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index 643f457..49bc4c0 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -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");
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH] NVMe: nvme_core_exit() should do cleanup in the reverse order as nvme_core_init does
  2016-04-28  8:19 [PATCH] NVMe: nvme_core_exit() should do cleanup in the reverse order as nvme_core_init does Wang Sheng-Hui
@ 2016-05-01 18:05 ` Christoph Hellwig
  2016-05-02  0:18   ` [PATCH] NVMe: nvme_core_exit() should do cleanup in the reverseorder " Wang Sheng-Hui
  2016-05-02 15:11 ` [PATCH] NVMe: nvme_core_exit() should do cleanup in the reverse order " Jens Axboe
  1 sibling, 1 reply; 4+ messages in thread
From: Christoph Hellwig @ 2016-05-01 18:05 UTC (permalink / raw)


On Thu, Apr 28, 2016@04:19:31PM +0800, Wang Sheng-Hui wrote:
> nvme_core_init does:
>     1) register_blkdev
>     2) __register_chrdev
>     3) class_create
> 
> nvme_core_exit should do cleanup in the reverse order.

Not sure why this would matter, but it looks correct to me:

Reviewed-by: Christoph Hellwig <hch at lst.de>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] NVMe: nvme_core_exit() should do cleanup in the reverseorder as nvme_core_init does
  2016-05-01 18:05 ` Christoph Hellwig
@ 2016-05-02  0:18   ` Wang Sheng-Hui
  0 siblings, 0 replies; 4+ messages in thread
From: Wang Sheng-Hui @ 2016-05-02  0:18 UTC (permalink / raw)


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";<hch@infradead.org>;
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



On Thu, Apr 28, 2016@04:19:31PM +0800, Wang Sheng-Hui wrote:
> nvme_core_init does:
>     1) register_blkdev
>     2) __register_chrdev
>     3) class_create
> 
> nvme_core_exit should do cleanup in the reverse order.

Not sure why this would matter, but it looks correct to me:

Reviewed-by: Christoph Hellwig <hch at lst.de>

_______________________________________________
Linux-nvme mailing list
Linux-nvme at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] NVMe: nvme_core_exit() should do cleanup in the reverse order as nvme_core_init does
  2016-04-28  8:19 [PATCH] NVMe: nvme_core_exit() should do cleanup in the reverse order as nvme_core_init does Wang Sheng-Hui
  2016-05-01 18:05 ` Christoph Hellwig
@ 2016-05-02 15:11 ` Jens Axboe
  1 sibling, 0 replies; 4+ messages in thread
From: Jens Axboe @ 2016-05-02 15:11 UTC (permalink / raw)


On 04/28/2016 02:19 AM, Wang Sheng-Hui wrote:
> nvme_core_init does:
>      1) register_blkdev
>      2) __register_chrdev
>      3) class_create
>
> nvme_core_exit should do cleanup in the reverse order.

Added for 4.7.


-- 
Jens Axboe

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-05-02 15:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-28  8:19 [PATCH] NVMe: nvme_core_exit() should do cleanup in the reverse order as nvme_core_init does Wang Sheng-Hui
2016-05-01 18:05 ` Christoph Hellwig
2016-05-02  0:18   ` [PATCH] NVMe: nvme_core_exit() should do cleanup in the reverseorder " Wang Sheng-Hui
2016-05-02 15:11 ` [PATCH] NVMe: nvme_core_exit() should do cleanup in the reverse order " Jens Axboe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.