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".
This commit is contained in:
Thomas Haller 2018-07-11 09:56:21 +02:00
parent a9d81031f4
commit 24082ad09e

View file

@ -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;