]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
Don't print error on failed to open in nvme-topology.c
authorEric Curtin <ericcurtin17@gmail.com>
Wed, 10 Feb 2021 18:32:01 +0000 (18:32 +0000)
committerKeith Busch <kbusch@kernel.org>
Wed, 10 Feb 2021 18:39:49 +0000 (11:39 -0700)
Sometimes opens are intentionally attempted and allowed fail, such as
the "nvme list" command.

nvme-topology.c

index 436926b1e83f243b1e2e6b1b499c0692c4af4215..c0e2d5100b99712dcbc5dbc0cab93325971854a7 100644 (file)
@@ -60,10 +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) {