From: Wang Shilong <wangsl.fnst@cn.fujitsu.com>
To: linux-btrfs@vger.kernel.org
Subject: [PATCH] Btrfs-progs: fix compile warning in is_ssd()
Date: Wed, 4 Sep 2013 19:43:20 +0800 [thread overview]
Message-ID: <1378295000-19509-1-git-send-email-wangsl.fnst@cn.fujitsu.com> (raw)
mkfs.c: In function ‘is_ssd’:
mkfs.c:1168:26: warning: ignoring return value of ‘blkid_devno_to_wholedisk’,
declared with attribute warn_unused_result [-Wunused-result]
blkid_devno_to_wholedisk(devno, wholedisk, sizeof(wholedisk), NULL);
Signed-off-by: Wang Shilong <wangsl.fnst@cn.fujitsu.com>
---
mkfs.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/mkfs.c b/mkfs.c
index 6d340cb..bcaca43 100644
--- a/mkfs.c
+++ b/mkfs.c
@@ -1209,6 +1209,7 @@ static int is_ssd(const char *file)
dev_t devno;
int fd;
char rotational;
+ int ret;
probe = blkid_new_probe_from_filename(file);
if (!probe)
@@ -1220,7 +1221,12 @@ static int is_ssd(const char *file)
return 0;
/* Get whole disk name (not full path) for this devno */
- blkid_devno_to_wholedisk(devno, wholedisk, sizeof(wholedisk), NULL);
+ ret = blkid_devno_to_wholedisk(devno,
+ wholedisk, sizeof(wholedisk), NULL);
+ if (ret) {
+ blkid_free_probe(probe);
+ return 0;
+ }
snprintf(sysfs_path, PATH_MAX, "/sys/block/%s/queue/rotational",
wholedisk);
--
1.8.3.1
reply other threads:[~2013-09-04 11:45 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1378295000-19509-1-git-send-email-wangsl.fnst@cn.fujitsu.com \
--to=wangsl.fnst@cn.fujitsu.com \
--cc=linux-btrfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).