XFS: Use a signed return type for suffix_kstrtoint()
Subsystems (2)
PATCH 1/1 XFS: Use a signed return type for suffix_kstrtoint()
From: Markus Elfring <[email protected]>
Date: Sun, 20 Dec 2015 07:56:36 +0100
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.
--- fs/xfs/xfs_super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/xfs/xfs_super.c +1 -1
@@ -137,7 +137,7 @@ static const match_table_t tokens = { }; -STATIC unsigned long +STATIC intsuffix_kstrtoint (char *s,unsigned int base,int *res) {int last, shift_left_factor =0 , _res;
Signature · 1 line
2.6.3
Quoted 11 lines · SF Markus Elfring
From: Markus Elfring <[email protected]>
Date: Sun, 20 Dec 2015 07:56:36 +0100The 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 <[email protected]>
yep, looks like an oversight left over from a17164e5
Harmless, because callers only check for non-zero value, but still worth fixing.
Thanks,
-Eric
Quoted 10 lines
--- fs/xfs/xfs_super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)fs/xfs/xfs_super.c +0
-0
fs/xfs/xfs_super.c static const match_table_t tokens = { · line 143
Quoted 8 lines
fs/xfs/xfs_super.c +1
-1@@ -137,7 +137,7 @@ static const match_table_t tokens = { }; -STATIC unsigned long +STATIC intsuffix_kstrtoint (char *s,unsigned int base,int *res) {int last, shift_left_factor =0 , _res;
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Quoted 9 lines · Eric Sandeen
Quoted 8 lines · SF Markus Elfring
From: Markus Elfring <[email protected]>
Date: Sun, 20 Dec 2015 07:56:36 +0100The 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.
Quoted 8 lines
Quoted 3 lines
This issue was detected by using the Coccinelle software.
Signed-off-by Markus Elfring <[email protected]>yep, looks like an oversight left over from
a17164e5Harmless, because callers only check for non-zero value, but still worth fixing.
Perhaps addressing the actual bug in that code would be a more appropriate use of our time. i.e. the undetected integer overflow on left shift....
Cheers,
Dave.
Signature · 7 lines
Dave Chinner [email protected] _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs