nvme: mark shutdown_timeout static
authorChristoph Hellwig <hch@lst.de>
Mon, 12 Jun 2017 16:30:51 +0000 (18:30 +0200)
committerChristoph Hellwig <hch@lst.de>
Thu, 15 Jun 2017 12:30:29 +0000 (14:30 +0200)
And open code the SHUTDOWN_TIMEOUT macro.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/host/core.c
drivers/nvme/host/nvme.h

index 4554c605f24eafa8ccc83cb17c7c063f9465503e..c40393f6b1893f174422cd348a4cc038e927cda7 100644 (file)
@@ -45,7 +45,7 @@ module_param_named(io_timeout, nvme_io_timeout, byte, 0644);
 MODULE_PARM_DESC(io_timeout, "timeout in seconds for I/O");
 EXPORT_SYMBOL_GPL(nvme_io_timeout);
 
-unsigned char shutdown_timeout = 5;
+static unsigned char shutdown_timeout = 5;
 module_param(shutdown_timeout, byte, 0644);
 MODULE_PARM_DESC(shutdown_timeout, "timeout in seconds for controller shutdown");
 
@@ -1357,7 +1357,7 @@ EXPORT_SYMBOL_GPL(nvme_enable_ctrl);
 
 int nvme_shutdown_ctrl(struct nvme_ctrl *ctrl)
 {
-       unsigned long timeout = SHUTDOWN_TIMEOUT + jiffies;
+       unsigned long timeout = jiffies + (shutdown_timeout * HZ);
        u32 csts;
        int ret;
 
index f88c6ce5e742ca5e379e0c407bb0fed9cf60207b..dc4bda6e03d0a58eab693c9fa465b2fe63719922 100644 (file)
@@ -27,9 +27,6 @@ extern unsigned char nvme_io_timeout;
 extern unsigned char admin_timeout;
 #define ADMIN_TIMEOUT  (admin_timeout * HZ)
 
-extern unsigned char shutdown_timeout;
-#define SHUTDOWN_TIMEOUT       (shutdown_timeout * HZ)
-
 #define NVME_DEFAULT_KATO      5
 #define NVME_KATO_GRACE                10