summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDipendra Khadka <kdipendra88@gmail.com>2024-09-22 16:47:01 +0000
committerMikulas Patocka <mpatocka@redhat.com>2024-09-26 17:26:56 +0200
commit4feb014bc79a42485b15bc3912dd3b0bca592520 (patch)
treec48cfb192872e68b04d1c555b3aca63618e40b5f
parent66cac80698cd1e31ae9bc5c271e83209903d4861 (diff)
dm-cache: remove pointless error check
Smatch reported following: ''' drivers/md/dm-cache-target.c:3204 parse_cblock_range() warn: sscanf doesn't return error codes drivers/md/dm-cache-target.c:3217 parse_cblock_range() warn: sscanf doesn't return error codes ''' Sscanf doesn't return negative values at all. Signed-off-by: Dipendra Khadka <kdipendra88@gmail.com> Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
-rw-r--r--drivers/md/dm-cache-target.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/drivers/md/dm-cache-target.c b/drivers/md/dm-cache-target.c
index 17f0fab1e254..621be35c2b00 100644
--- a/drivers/md/dm-cache-target.c
+++ b/drivers/md/dm-cache-target.c
@@ -3200,8 +3200,6 @@ static int parse_cblock_range(struct cache *cache, const char *str,
* Try and parse form (ii) first.
*/
r = sscanf(str, "%llu-%llu%c", &b, &e, &dummy);
- if (r < 0)
- return r;
if (r == 2) {
result->begin = to_cblock(b);
@@ -3213,8 +3211,6 @@ static int parse_cblock_range(struct cache *cache, const char *str,
* That didn't work, try form (i).
*/
r = sscanf(str, "%llu%c", &b, &dummy);
- if (r < 0)
- return r;
if (r == 1) {
result->begin = to_cblock(b);