From: Paolo Bonzini Date: Fri, 14 Oct 2016 08:45:45 +0000 (+0200) Subject: checkpatch: tweak "struct should normally be const" warning X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=e20e718cdea2527ce560a03c5d8cd248decb537a;p=qemu.git checkpatch: tweak "struct should normally be const" warning Avoid triggering on typedef struct BlockJobDriver BlockJobDriver; or struct BlockJobDriver { Cc: John Snow Signed-off-by: Paolo Bonzini --- 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); }