]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
plugins/wdc: Add type case for feature id
authorDaniel Wagner <dwagner@suse.de>
Fri, 23 Sep 2022 11:43:57 +0000 (13:43 +0200)
committerDaniel Wagner <dwagner@suse.de>
Fri, 23 Sep 2022 11:43:57 +0000 (13:43 +0200)
clang reports

../plugins/wdc/wdc-nvme.c:9000:36: warning: implicit conversion from enumeration type 'NVME_FEATURE_IDENTIFIERS' (aka 'enum _NVME_FEATURE_IDENTIFIERS') to different enumeration type 'enum nvme_features_id' [-Wenum-conversion]
                                             deFeatureIdList[listIdx].featureId,
                                             ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~

Add type case to avoid the warning. Ideally, the plugin would not
introduce their own enum value.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
plugins/wdc/wdc-nvme.c

index a5333eda52f78e15e68e46f13b028b4f91011d04..8b327b341792910c885245cbe4c324d903841446 100644 (file)
@@ -8997,7 +8997,7 @@ static int wdc_do_drive_essentials(nvme_root_t r, struct nvme_dev *dev,
                if (deFeatureIdList[listIdx].featureId == FID_LBA_RANGE_TYPE)
                        continue;
                ret = nvme_get_features_data(dev_fd(dev),
-                                            deFeatureIdList[listIdx].featureId,
+                                            (enum nvme_features_id)deFeatureIdList[listIdx].featureId,
                                             WDC_DE_GLOBAL_NSID,
                                             sizeof(featureIdBuff),
                                             &featureIdBuff, &result);