From e20e718cdea2527ce560a03c5d8cd248decb537a Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Fri, 14 Oct 2016 10:45:45 +0200 Subject: [PATCH] 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 --- scripts/checkpatch.pl | 4 ++-- 1 file 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); } -- 2.11.0