Commit 77016199 authored by Dan Carpenter's avatar Dan Carpenter Committed by Jens Axboe

nvme: cleanup double shift issue

The problem here is that set_bit() and test_bit() take a bit number so
we should be passing 0 but instead we're passing (1 << 0) which leads to
a double shift.  It doesn't cause a runtime bug in the current code
because it's done consistently and we only set that one bit.

I decided to just re-use NVME_AER_NOTICE_NS_CHANGED instead of
introducing a new define for this.
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: default avatarSagi Grimberg <sagi@grimberg.me>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 69f4eb9f
...@@ -3245,7 +3245,7 @@ static void nvme_scan_work(struct work_struct *work) ...@@ -3245,7 +3245,7 @@ static void nvme_scan_work(struct work_struct *work)
WARN_ON_ONCE(!ctrl->tagset); WARN_ON_ONCE(!ctrl->tagset);
if (test_and_clear_bit(EVENT_NS_CHANGED, &ctrl->events)) { if (test_and_clear_bit(NVME_AER_NOTICE_NS_CHANGED, &ctrl->events)) {
if (nvme_scan_changed_ns_log(ctrl)) if (nvme_scan_changed_ns_log(ctrl))
goto out_sort_namespaces; goto out_sort_namespaces;
dev_info(ctrl->device, "rescanning namespaces.\n"); dev_info(ctrl->device, "rescanning namespaces.\n");
...@@ -3386,7 +3386,7 @@ static void nvme_handle_aen_notice(struct nvme_ctrl *ctrl, u32 result) ...@@ -3386,7 +3386,7 @@ static void nvme_handle_aen_notice(struct nvme_ctrl *ctrl, u32 result)
{ {
switch ((result & 0xff00) >> 8) { switch ((result & 0xff00) >> 8) {
case NVME_AER_NOTICE_NS_CHANGED: case NVME_AER_NOTICE_NS_CHANGED:
set_bit(EVENT_NS_CHANGED, &ctrl->events); set_bit(NVME_AER_NOTICE_NS_CHANGED, &ctrl->events);
nvme_queue_scan(ctrl); nvme_queue_scan(ctrl);
break; break;
case NVME_AER_NOTICE_FW_ACT_STARTING: case NVME_AER_NOTICE_FW_ACT_STARTING:
......
...@@ -194,7 +194,6 @@ struct nvme_ctrl { ...@@ -194,7 +194,6 @@ struct nvme_ctrl {
struct delayed_work ka_work; struct delayed_work ka_work;
struct nvme_command ka_cmd; struct nvme_command ka_cmd;
struct work_struct fw_act_work; struct work_struct fw_act_work;
#define EVENT_NS_CHANGED (1 << 0)
unsigned long events; unsigned long events;
/* Power saving configuration */ /* Power saving configuration */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment