XFS: Use a signed return type for suffix_kstrtoint()
authorMarkus Elfring <elfring@users.sourceforge.net>
Mon, 4 Jan 2016 05:13:21 +0000 (16:13 +1100)
committerDave Chinner <david@fromorbit.com>
Mon, 4 Jan 2016 05:13:21 +0000 (16:13 +1100)
The return type "unsigned long" was used by the suffix_kstrtoint()
function even though it will eventually return a negative error code.
Improve this implementation detail by using the type "int" instead.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
fs/xfs/xfs_super.c

index 36bd8825bfb03cd2faafbecd202730869f8321d3..b35775752b7451c8f7679eb1b17256584283003f 100644 (file)
@@ -137,7 +137,7 @@ static const match_table_t tokens = {
 };
 
 
-STATIC unsigned long
+STATIC int
 suffix_kstrtoint(char *s, unsigned int base, int *res)
 {
        int     last, shift_left_factor = 0, _res;