]> www.infradead.org Git - users/hch/nvme-cli.git/commitdiff
suppress missing attribute warnings
authorKeith Busch <kbusch@kernel.org>
Tue, 31 Mar 2020 18:11:17 +0000 (03:11 +0900)
committerKeith Busch <kbusch@kernel.org>
Tue, 31 Mar 2020 18:12:03 +0000 (03:12 +0900)
Attribute existence is dependent on kernel versions. Don't automatically
warn if we fail to find the attribute, let the caller decide how to deal
with it.

Reported-by: Jeffrey Lien <Jeff.Lien@wdc.com>
Signed-off-by: Keith Busch <kbusch@kernel.org>
nvme-topology.c

index f2d0e7a4e344d12c47b42089c727f5e033fb6f0f..40b8a75145fd66b0d3992e800a496254a960d13b 100644 (file)
@@ -60,11 +60,8 @@ char *nvme_get_ctrl_attr(char *path, const char *attr)
                goto err_free_path;
 
        fd = open(attrpath, O_RDONLY);
-       if (fd < 0) {
-               fprintf(stderr, "Failed to open %s: %s\n",
-                               attrpath, strerror(errno));
+       if (fd < 0)
                goto err_free_value;
-       }
 
        ret = read(fd, value, 1024);
        if (ret < 0) {