git: d40fc35f930e - main - nvme: Make is_initialized a bool
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 13 Aug 2024 21:55:57 UTC
The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=d40fc35f930eb90c260d7a230d6cb2ffad73ffec commit d40fc35f930eb90c260d7a230d6cb2ffad73ffec Author: Warner Losh <imp@FreeBSD.org> AuthorDate: 2024-08-13 22:42:27 +0000 Commit: Warner Losh <imp@FreeBSD.org> CommitDate: 2024-08-13 22:46:41 +0000 nvme: Make is_initialized a bool is_initialized is used as a bool everywhere, and we never do any atomics with it, so make it really a bool. Sponsored by: Netflix --- sys/dev/nvme/nvme_ctrlr.c | 4 ++-- sys/dev/nvme/nvme_private.h | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/sys/dev/nvme/nvme_ctrlr.c b/sys/dev/nvme/nvme_ctrlr.c index 52834cb26b8e..d97575a19584 100644 --- a/sys/dev/nvme/nvme_ctrlr.c +++ b/sys/dev/nvme/nvme_ctrlr.c @@ -1167,7 +1167,7 @@ fail: nvme_sysctl_initialize_ctrlr(ctrlr); config_intrhook_disestablish(&ctrlr->config_hook); - ctrlr->is_initialized = 1; + ctrlr->is_initialized = true; nvme_notify_new_controller(ctrlr); TSEXIT(); } @@ -1567,7 +1567,7 @@ nvme_ctrlr_construct(struct nvme_controller *ctrlr, device_t dev) taskqueue_start_threads(&ctrlr->taskqueue, 2, PI_DISK, "nvme taskq"); ctrlr->is_resetting = 0; - ctrlr->is_initialized = 0; + ctrlr->is_initialized = false; ctrlr->notification_sent = 0; TASK_INIT(&ctrlr->reset_task, 0, nvme_ctrlr_reset_task, ctrlr); STAILQ_INIT(&ctrlr->fail_req); diff --git a/sys/dev/nvme/nvme_private.h b/sys/dev/nvme/nvme_private.h index 05b5f3189eb2..57613242ea84 100644 --- a/sys/dev/nvme/nvme_private.h +++ b/sys/dev/nvme/nvme_private.h @@ -298,12 +298,13 @@ struct nvme_controller { void *cons_cookie[NVME_MAX_CONSUMERS]; uint32_t is_resetting; - uint32_t is_initialized; uint32_t notification_sent; bool is_failed; bool is_dying; bool isr_warned; + bool is_initialized; + STAILQ_HEAD(, nvme_request) fail_req; /* Host Memory Buffer */