diff options
author | Thomas Haller <thaller@redhat.com> | 2018-07-11 09:56:21 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2018-07-11 12:02:06 +0200 |
commit | a9ca154ffff30951ce30d61b58e7ea498742ae59 (patch) | |
tree | b370b1263cb1cc13ff32a1a9f8afb4d8c4dac1f0 /contrib | |
parent | 04405bb631129bb05d2fd6b7bd840bc0c0b8588f (diff) |
checkpatch: check against using "unsigned int" and "$INT_TYPE unsigned|signed"
Don't use the integer type before signed/unsigned, but the
other way around. That is,
unsigned long var;
instead of
long unsigned var;
Also, just use "unsigned" instead of "unsigned int".
Diffstat (limited to 'contrib')
-rwxr-xr-x | contrib/scripts/checkpatch.pl | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/contrib/scripts/checkpatch.pl b/contrib/scripts/checkpatch.pl index 6b1e766fc..aa791dc21 100755 --- a/contrib/scripts/checkpatch.pl +++ b/contrib/scripts/checkpatch.pl @@ -121,6 +121,8 @@ next if $filename =~ /\/nm-[^\/]+-enum-types\.[ch]$/; complain ('Tabs are only allowed at the beginning of a line') if $line =~ /[^\t]\t/; complain ('Trailing whitespace') if $line =~ /[ \t]$/; complain ('Don\'t use glib typedefs for char/short/int/long/float/double') if $line =~ /\bg(char|short|int|long|float|double)\b/; +complain ("Don't use \"$1 $2\" instead of \"$2 $1\"") if $line =~ /\b(char|short|int|long) +(unsigned|signed)\b/; +complain ("Don't use \"unsigned int\" but just use \"unsigned\"") if $line =~ /\b(unsigned) +(int)\b/; # Further on we process stuff without comments. $_ = $line; |