From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42029) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XLxXa-0004e9-MP for qemu-devel@nongnu.org; Mon, 25 Aug 2014 12:54:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XLxXW-0005sP-ET for qemu-devel@nongnu.org; Mon, 25 Aug 2014 12:54:46 -0400 Received: from mail-wi0-x22a.google.com ([2a00:1450:400c:c05::22a]:39925) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XLxXW-0005sE-1W for qemu-devel@nongnu.org; Mon, 25 Aug 2014 12:54:42 -0400 Received: by mail-wi0-f170.google.com with SMTP id f8so3975395wiw.1 for ; Mon, 25 Aug 2014 09:54:41 -0700 (PDT) Sender: Paolo Bonzini From: Paolo Bonzini Date: Mon, 25 Aug 2014 18:54:32 +0200 Message-Id: <1408985672-14423-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PATCH] checkpatch.pl: adjust typedef definition to QEMU coding style List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: aik@ozlabs.ru, Peter Maydell , Markus Armbruster , Stefan Weil Most QEMU typedefs are camelcase, starting with one uppercase letter and containing at least one lowercase letter. There are a few all-uppercase types, add the most common too. This fixes recognition of types in lines such as static __attribute__((unused)) inline void tcg_out8(TCGContext *s, uint8_t v) (Example provided by Peter Maydell). Reported-by: Alexey Kardashevskiy Cc: Peter Maydell Cc: Stefan Weil Cc: Markus Armbruster Signed-off-by: Paolo Bonzini --- scripts/checkpatch.pl | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 9d46e5a..053e432 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -206,9 +206,13 @@ our $UTF8 = qr { | \xF4[\x80-\x8F][\x80-\xBF]{2} # plane 16 }x; +# There are still some false positives, but this catches most +# common cases. our $typeTypedefs = qr{(?x: - (?:__)?(?:u|s|be|le)(?:8|16|32|64)| - atomic_t + [A-Z][A-Z\d_]*[a-z][A-Za-z\d_]* # camelcase + | [A-Z][A-Z\d_]*AIOCB # all uppercase + | [A-Z][A-Z\d_]*CPU # all uppercase + | QEMUBH # all uppercase )}; our $logFunctions = qr{(?x: -- 1.8.3.1