Skip to content

Commit 4feb014

Browse files
Dipendra333Mikulas Patocka
authored andcommitted
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 <[email protected]> Signed-off-by: Mikulas Patocka <[email protected]>
1 parent 66cac80 commit 4feb014

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

drivers/md/dm-cache-target.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3200,8 +3200,6 @@ static int parse_cblock_range(struct cache *cache, const char *str,
32003200
* Try and parse form (ii) first.
32013201
*/
32023202
r = sscanf(str, "%llu-%llu%c", &b, &e, &dummy);
3203-
if (r < 0)
3204-
return r;
32053203

32063204
if (r == 2) {
32073205
result->begin = to_cblock(b);
@@ -3213,8 +3211,6 @@ static int parse_cblock_range(struct cache *cache, const char *str,
32133211
* That didn't work, try form (i).
32143212
*/
32153213
r = sscanf(str, "%llu%c", &b, &dummy);
3216-
if (r < 0)
3217-
return r;
32183214

32193215
if (r == 1) {
32203216
result->begin = to_cblock(b);

0 commit comments

Comments
 (0)