From: Keith Busch Date: Tue, 31 Mar 2020 18:11:17 +0000 (+0900) Subject: suppress missing attribute warnings X-Git-Tag: v1.11~17 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=6ad43080afda4010f4597f46cd3dd61e49ea11f5;p=users%2Fhch%2Fnvme-cli.git suppress missing attribute warnings 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 Signed-off-by: Keith Busch --- diff --git a/nvme-topology.c b/nvme-topology.c index f2d0e7a..40b8a75 100644 --- a/nvme-topology.c +++ b/nvme-topology.c @@ -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) {