Skip to content

Commit

Permalink
nvme: use NVME_CHECK() to check get features select field value
Browse files Browse the repository at this point in the history
Use the macro instead of comparing the long filed value definition.

Signed-off-by: Tokunori Ikegami <[email protected]>
  • Loading branch information
ikegami-t committed Sep 16, 2024
1 parent 1d208bb commit bacfd88
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions nvme.c
Original file line number Diff line number Diff line change
Expand Up @@ -4553,7 +4553,7 @@ static int get_feature_id(struct nvme_dev *dev, struct feat_cfg *cfg,
cfg->cdw11 |= 0xff << 16;
}

if (cfg->sel == NVME_GET_FEATURES_SEL_SUPPORTED)
if (NVME_CHECK(cfg->sel, GET_FEATURES_SEL, SUPPORTED))
cfg->data_len = 0;

if (cfg->data_len) {
Expand Down Expand Up @@ -4592,7 +4592,7 @@ static void get_feature_id_print(struct feat_cfg cfg, int err, __u32 result,
if (!err) {
if (!cfg.raw_binary || !buf) {
nvme_feature_show(cfg.feature_id, cfg.sel, result);
if (cfg.sel == NVME_GET_FEATURES_SEL_SUPPORTED)
if (NVME_CHECK(cfg.sel, GET_FEATURES_SEL, SUPPORTED))
nvme_show_select_result(cfg.feature_id, result);
else if (cfg.human_readable)
nvme_feature_show_fields(cfg.feature_id, result,
Expand Down

0 comments on commit bacfd88

Please sign in to comment.