aboutsummaryrefslogtreecommitdiff
path: root/scripts/checkpatch.pl
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2016-10-14 10:45:45 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2016-11-01 16:06:57 +0100
commite20e718cdea2527ce560a03c5d8cd248decb537a (patch)
tree3ef3fde0a028fbc7c357b3db8ef31b4e9924b345 /scripts/checkpatch.pl
parent39542105bbb19c690219d2f22844d8dfbd9bba05 (diff)
checkpatch: tweak "struct should normally be const" warning
Avoid triggering on typedef struct BlockJobDriver BlockJobDriver; or struct BlockJobDriver { Cc: John Snow <jsnow@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'scripts/checkpatch.pl')
-rwxr-xr-xscripts/checkpatch.pl4
1 files changed, 2 insertions, 2 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 3afa19a766..1f1c9d3498 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2498,8 +2498,8 @@ sub process {
VMStateDescription|
VMStateInfo}x;
if ($line !~ /\bconst\b/ &&
- $line =~ /\b($struct_ops)\b/) {
- ERROR("struct $1 should normally be const\n" .
+ $line =~ /\b($struct_ops)\b.*=/) {
+ ERROR("initializer for struct $1 should normally be const\n" .
$herecurr);
}