From 6ad43080afda4010f4597f46cd3dd61e49ea11f5 Mon Sep 17 00:00:00 2001 From: Keith Busch Date: Wed, 1 Apr 2020 03:11:17 +0900 Subject: [PATCH] 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 --- nvme-topology.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/nvme-topology.c b/nvme-topology.c index f2d0e7a4..40b8a751 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) { -- 2.50.1